diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-11 00:49:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-16 16:00:23 +0200 |
commit | 7edd1cd6fa9f4e8eaf0819a48c13e1f1d7dbf674 (patch) | |
tree | 63ccd03b5d05810e4860506c4a824a037502af85 | |
parent | 21b1dd8f74c94ec263b1c127863a8d0591c18b5e (diff) | |
download | ffmpeg-7edd1cd6fa9f4e8eaf0819a48c13e1f1d7dbf674.tar.gz |
avcodec/mpeg12dec: Fixes runtime error: division by zero
Fixes: 1464/clusterfuzz-testcase-minimized-4925445571084288
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c0ece1f4addf8ac31df95775a2d36be2a55fc759)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/mpeg12dec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index eb90af2143..50360c8132 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1242,7 +1242,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) { // MPEG-1 aspect - avctx->sample_aspect_ratio = av_d2q(1.0 / ff_mpeg1_aspect[s->aspect_ratio_info], 255); + AVRational aspect_inv = av_d2q(ff_mpeg1_aspect[s->aspect_ratio_info], 255); + avctx->sample_aspect_ratio = (AVRational) { aspect_inv.den, aspect_inv.num }; } else { // MPEG-2 // MPEG-2 aspect if (s->aspect_ratio_info > 1) { |