summaryrefslogtreecommitdiff
path: root/libavcodec/idctdsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-05-28 21:19:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-05-30 17:58:08 +0200
commitb3332a182f8ba33a34542e4a0370f38b914ccf7d (patch)
treee64ea3bae2d077a04d8559b5903b2dba8a99b1d2 /libavcodec/idctdsp.c
parent1aa519245193485cd74a52aacc99fd3fec58d0b4 (diff)
downloadffmpeg-b3332a182f8ba33a34542e4a0370f38b914ccf7d.tar.gz
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/idctdsp.c')
-rw-r--r--libavcodec/idctdsp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 662033bd78..954066a5e3 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -258,7 +258,7 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
if (avctx->bits_per_raw_sample == 10 || avctx->bits_per_raw_sample == 9) {
/* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT
However, it only uses idct_put */
- if (avctx->codec_id == AV_CODEC_ID_MPEG4 && avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO)
+ if (c->mpeg4_studio_profile)
c->idct_put = ff_simple_idct_put_int32_10bit;
else {
c->idct_put = ff_simple_idct_put_int16_10bit;