aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-10 20:20:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commitc82ae7ea2a8b0460700e97c29ed8b10804f84cca (patch)
treeeab95dd8b58ab79f1a12bac31433e92cd2f19014 /libavcodec
parent461bcc537914ec396128bded2cc2034edcbd6db4 (diff)
downloadffmpeg-c82ae7ea2a8b0460700e97c29ed8b10804f84cca.tar.gz
vcodec/vc1: compute rangex/y only for P/B frames
Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int' Fixes: 16976/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-4847262047404032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit e75e7fe1601b97c31e3ce90473ab71b9a0667573) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vc1.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index e2a2ff0dc6..54706caaf0 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -1320,16 +1320,17 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
break;
}
- if (v->fcm != PROGRESSIVE && !v->s.quarter_sample) {
- v->range_x <<= 1;
- v->range_y <<= 1;
- }
/* AC Syntax */
v->c_ac_table_index = decode012(gb);
if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI) {
v->y_ac_table_index = decode012(gb);
}
+ else if (v->fcm != PROGRESSIVE && !v->s.quarter_sample) {
+ v->range_x <<= 1;
+ v->range_y <<= 1;
+ }
+
/* DC Syntax */
v->s.dc_table_index = get_bits1(gb);
if ((v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)