Browse code

lavf/jacosubdec: fix FPE in case timeres is badly set.

Clément Bœsch authored on 2012/06/30 02:38:09
Showing 1 changed files
... ...
@@ -219,7 +219,10 @@ static int jacosub_read_header(AVFormatContext *s)
219 219
             break;
220 220
         case 'T': // ...but must be placed after TIMERES
221 221
             jacosub->timeres = strtol(p, NULL, 10);
222
-            av_bprintf(&header, "#T %s", p);
222
+            if (!jacosub->timeres)
223
+                jacosub->timeres = 30;
224
+            else
225
+                av_bprintf(&header, "#T %s", p);
223 226
             break;
224 227
         }
225 228
     }