diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-03 00:27:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-04 12:11:36 +0200 |
commit | bd27a9364ca274ca97f1df6d984e88a0700fb235 (patch) | |
tree | a428799eee676771eece2d8743d4e83abfb8b85d /libavcodec/h263dec.c | |
parent | 3b10bb8772c76177cc47b8d15a6970f19dd11039 (diff) | |
download | ffmpeg-bd27a9364ca274ca97f1df6d984e88a0700fb235.tar.gz |
avcodec/mpeg4videodec: Remove use of FF_PROFILE_MPEG4_SIMPLE_STUDIO as indicator of studio profile
The profile field is changed by code inside and outside the decoder,
its not a reliable indicator of the internal codec state.
Maintaining it consistency with studio_profile is messy.
Its easier to just avoid it and use only studio_profile
Fixes: assertion failure
Fixes: ffmpeg_crash_9.avi
Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index f8a38083f2..5967fca285 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -47,9 +47,10 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) { + MpegEncContext *s = avctx->priv_data; /* MPEG-4 Studio Profile only, not supported by hardware */ if (avctx->bits_per_raw_sample > 8) { - av_assert1(avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO); + av_assert1(s->studio_profile); return avctx->pix_fmt; } @@ -670,7 +671,8 @@ retry: av_assert1(s->bitstream_buffer_size == 0); frame_end: - ff_er_frame_end(&s->er); + if (!s->studio_profile) + ff_er_frame_end(&s->er); if (avctx->hwaccel) { ret = avctx->hwaccel->end_frame(avctx); |