From b3332a182f8ba33a34542e4a0370f38b914ccf7d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 28 May 2018 21:19:08 +0200 Subject: avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 , Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/mpegvideo.c') 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 -- cgit v1.2.3