diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-05-28 21:19:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-05-30 17:58:08 +0200 |
commit | b3332a182f8ba33a34542e4a0370f38b914ccf7d (patch) | |
tree | e64ea3bae2d077a04d8559b5903b2dba8a99b1d2 /libavcodec/mpegvideo.c | |
parent | 1aa519245193485cd74a52aacc99fd3fec58d0b4 (diff) |
avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile
These 2 fields are not always the same, it is simpler to always use the same field
for detecting studio profile
Fixes: null pointer dereference
Fixes: ffmpeg_crash_3.avi
Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 45ea0f09e9..f75c0fd9b3 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -329,6 +329,8 @@ static av_cold int dct_init(MpegEncContext *s) av_cold void ff_mpv_idct_init(MpegEncContext *s) { + if (s->codec_id == AV_CODEC_ID_MPEG4) + s->idsp.mpeg4_studio_profile = s->studio_profile; ff_idctdsp_init(&s->idsp, s->avctx); /* load & permutate scantables |