diff --git a/libavcodec/h264.c b/libavcodec/h264.c index c3771f2b68..205f8018ec 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -7167,7 +7167,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ } sps->ref_frame_count= get_ue_golomb_31(&s->gb); - if(sps->ref_frame_count > MAX_PICTURE_COUNT-2 || sps->ref_frame_count >= 32U){ + if(sps->ref_frame_count > MAX_PICTURE_COUNT-2 || sps->ref_frame_count > 16U){ av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n"); goto fail; }