1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-06-14 22:15:12 +02:00

avcodec/h264_parse: Check picture structure when initializing weight table

Fixes: runtime error: index 49 out of bounds for type 'int [48][2][2]'
Fixes: 2159/clusterfuzz-testcase-minimized-5267945972301824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2017-06-10 00:13:07 +02:00
parent e1b0044c23
commit 09096fb687
4 changed files with 14 additions and 9 deletions

View File

@ -202,7 +202,7 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
if ((p->ps.pps->weighted_pred && slice_type_nos == AV_PICTURE_TYPE_P) ||
(p->ps.pps->weighted_bipred_idc == 1 && slice_type_nos == AV_PICTURE_TYPE_B))
ff_h264_pred_weight_table(gb, p->ps.sps, ref_count, slice_type_nos,
&pwt, logctx);
&pwt, p->picture_structure, logctx);
if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag
int i;