Merge commit '7486418683bd2477772e03aab573cf846c12fb0d'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 27 Jan 2016 19:39:52 +0000 (19:39 +0000)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 27 Jan 2016 19:39:52 +0000 (19:39 +0000)
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
libavcodec/utils.c

@@@ -1474,20 -1049,19 +1474,30 @@@ FF_ENABLE_DEPRECATION_WARNING
  
          if (!avctx->rc_initial_buffer_occupancy)
              avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4;
+         if (avctx->ticks_per_frame &&
+             avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) {
+             av_log(avctx, AV_LOG_ERROR,
+                    "ticks_per_frame %d too large for the timebase %d/%d.",
+                    avctx->ticks_per_frame,
+                    avctx->time_base.num,
+                    avctx->time_base.den);
+             goto free_and_end;
+         }
      }
  
 -    if (avctx->codec->init && !(avctx->active_thread_type & FF_THREAD_FRAME)) {
 +    avctx->pts_correction_num_faulty_pts =
 +    avctx->pts_correction_num_faulty_dts = 0;
 +    avctx->pts_correction_last_pts =
 +    avctx->pts_correction_last_dts = INT64_MIN;
 +
 +    if (   !CONFIG_GRAY && avctx->flags & AV_CODEC_FLAG_GRAY
 +        && avctx->codec_descriptor->type == AVMEDIA_TYPE_VIDEO)
 +        av_log(avctx, AV_LOG_WARNING,
 +               "gray decoding requested but not enabled at configuration time\n");
 +
 +    if (   avctx->codec->init && (!(avctx->active_thread_type&FF_THREAD_FRAME)
 +        || avctx->internal->frame_thread_encoder)) {
          ret = avctx->codec->init(avctx);
          if (ret < 0) {
              goto free_and_end;