Merge commit '70b1dcef2d859ae6b3e21d61de928c3dd0cf1aa4'
authorJames Almer <jamrial@gmail.com>
Mon, 1 Aug 2016 16:02:20 +0000 (13:02 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 1 Aug 2016 16:02:20 +0000 (13:02 -0300)
* commit '70b1dcef2d859ae6b3e21d61de928c3dd0cf1aa4':
  h264: tighten the valid range for ref_frame_count

Conflicts:
libavcodec/h264_ps.c

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/h264_ps.c

@@@ -455,10 -431,7 +455,9 @@@ int ff_h264_decode_seq_parameter_set(Ge
      }
  
      sps->ref_frame_count = get_ue_golomb_31(gb);
-     if (sps->ref_frame_count > H264_MAX_PICTURE_COUNT - 2 ||
-         sps->ref_frame_count > 16U) {
 +    if (avctx->codec_tag == MKTAG('S', 'M', 'V', '2'))
 +        sps->ref_frame_count = FFMAX(2, sps->ref_frame_count);
+     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;