mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avcodec/mpeg4videodec: Check P cbpy
Fixes undefined behavior Fixes: signal_sigsegv_c3097a_991_xtrem_e2_m64q15_a32sxx.3gp Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
75fd5ce4c1
commit
c06e556274
@ -1354,6 +1354,11 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
|
||||
else
|
||||
s->mcsel = 0;
|
||||
cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
|
||||
if (cbpy < 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"P cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
cbp = (cbpc & 3) | (cbpy << 2);
|
||||
if (dquant)
|
||||
|
Loading…
x
Reference in New Issue
Block a user