aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-18 10:04:44 +0200
committerAnton Khirnov <anton@khirnov.net>2016-06-21 11:14:07 +0200
commit70b1dcef2d859ae6b3e21d61de928c3dd0cf1aa4 (patch)
treefaff6c310c13907fe39069bd8c0536e142008fc5 /libavcodec
parentf638b67e5790735f34620bf82025c9b9d6fc7216 (diff)
downloadffmpeg-70b1dcef2d859ae6b3e21d61de928c3dd0cf1aa4.tar.gz
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.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_ps.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 46457a89d5..4a56c738bf 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -431,8 +431,7 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
}
sps->ref_frame_count = get_ue_golomb_31(gb);
- if (sps->ref_frame_count > H264_MAX_PICTURE_COUNT - 2 ||
- sps->ref_frame_count >= 32U) {
+ if (sps->ref_frame_count > MAX_DELAYED_PIC_COUNT) {
av_log(avctx, AV_LOG_ERROR,
"too many reference frames %d\n", sps->ref_frame_count);
goto fail;