diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-19 05:54:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-19 13:45:39 +0100 |
commit | 36fb07d1abc7738427c98cfb154e2d1b9bcc40fe (patch) | |
tree | a60685b09e3a46e5affd3161e17efe9227419145 /libavcodec | |
parent | b9936e59e8e0b17d7c1c41a910d86c31eb6142a5 (diff) | |
download | ffmpeg-36fb07d1abc7738427c98cfb154e2d1b9bcc40fe.tar.gz |
avcodec/mpeg4videodec: set field durations to safe values when they are invalid
Fixes division by 0
Fixes: 3c980274cecaca6ca5d6e517c0c1983e-signal_sigabrt_7ffff7125425_410_cov_3621042467_2_audio_streams.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpeg4videodec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 1771e71d06..22e706ebd7 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2297,8 +2297,10 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) ROUNDED_DIV(s->last_non_b_time - s->pp_time, ctx->t_frame)) * 2; s->pb_field_time = (ROUNDED_DIV(s->time, ctx->t_frame) - ROUNDED_DIV(s->last_non_b_time - s->pp_time, ctx->t_frame)) * 2; - if (!s->progressive_sequence) { - if (s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1) + if (s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1) { + s->pb_field_time = 2; + s->pp_field_time = 4; + if (!s->progressive_sequence) return FRAME_SKIPPED; } } |