lavf/jacosubdec: fix FPE in case timeres is badly set.
authorClément Bœsch <ubitux@gmail.com>
Fri, 29 Jun 2012 17:38:09 +0000 (19:38 +0200)
committerClément Bœsch <ubitux@gmail.com>
Fri, 29 Jun 2012 18:19:59 +0000 (20:19 +0200)
libavformat/jacosubdec.c

index 4c82650..cc4b978 100644 (file)
@@ -219,7 +219,10 @@ static int jacosub_read_header(AVFormatContext *s)
             break;
         case 'T': // ...but must be placed after TIMERES
             jacosub->timeres = strtol(p, NULL, 10);
-            av_bprintf(&header, "#T %s", p);
+            if (!jacosub->timeres)
+                jacosub->timeres = 30;
+            else
+                av_bprintf(&header, "#T %s", p);
             break;
         }
     }