From 0ef28e119e0d61258cd67c8eb8ba74df393ad07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Fri, 29 Jun 2012 19:38:09 +0200 Subject: [PATCH] lavf/jacosubdec: fix FPE in case timeres is badly set. --- libavformat/jacosubdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } }