mirror of https://git.ffmpeg.org/ffmpeg.git
h264: tighten the valid range for ref_frame_count
This field (which the spec calls max_num_ref_frames) must be less than or equal to MaxDpbFrames, which is at most 16.
This commit is contained in:
parent
f638b67e57
commit
70b1dcef2d
|
@ -431,8 +431,7 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
sps->ref_frame_count = get_ue_golomb_31(gb);
|
sps->ref_frame_count = get_ue_golomb_31(gb);
|
||||||
if (sps->ref_frame_count > H264_MAX_PICTURE_COUNT - 2 ||
|
if (sps->ref_frame_count > MAX_DELAYED_PIC_COUNT) {
|
||||||
sps->ref_frame_count >= 32U) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"too many reference frames %d\n", sps->ref_frame_count);
|
"too many reference frames %d\n", sps->ref_frame_count);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in New Issue