summaryrefslogtreecommitdiff
path: root/libavformat/jacosubdec.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-06-29 19:38:09 +0200
committerClément Bœsch <ubitux@gmail.com>2012-06-29 20:19:59 +0200
commit0ef28e119e0d61258cd67c8eb8ba74df393ad07b (patch)
treef5ef349c4ddb09797edb7befbd3c27e661122310 /libavformat/jacosubdec.c
parent60715511db338d860eb483586b055138fd5cdf0a (diff)
lavf/jacosubdec: fix FPE in case timeres is badly set.
Diffstat (limited to 'libavformat/jacosubdec.c')
-rw-r--r--libavformat/jacosubdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 4c82650692..cc4b978dae 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -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;
}
}