Merge remote-tracking branch 'qatar/release/9' into release/1.1
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Feb 2014 05:41:15 +0000 (06:41 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Feb 2014 05:41:15 +0000 (06:41 +0100)
* qatar/release/9:
  Update Changelog for 9.11
  oggparseogm: check timing variables
  mathematics: remove asserts from av_rescale_rnd()
  vc1: Always reset numref when parsing a new frame header.
  h264: reset num_reorder_frames if it is invalid

Conflicts:
Changelog
libavcodec/vc1.c
libavutil/mathematics.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/h264_ps.c
libavcodec/vc1.c
libavformat/oggparseogm.c
libavutil/mathematics.c

Simple merge
@@@ -836,13 -825,10 +836,13 @@@ int ff_vc1_parse_frame_header_adv(VC1Co
      int status;
      int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab; /* useful only for debugging */
      int scale, shift, i; /* for initializing LUT for intensity compensation */
 +    int field_mode, fcm;
  
-     v->numref=0;
+     v->numref          = 0;
      v->p_frame_skipped = 0;
      if (v->second_field) {
 +        if(v->fcm!=2 || v->field_mode!=1)
 +            return -1;
          v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
          if (v->fptype & 4)
              v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B;
@@@ -70,15 -68,18 +70,20 @@@ ogm_header(AVFormatContext *s, int idx
              acid[4] = 0;
              cid = strtol(acid, NULL, 16);
              st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, cid);
 -            st->need_parsing = AVSTREAM_PARSE_FULL;
 +            // our parser completely breaks AAC in Ogg
 +            if (st->codec->codec_id != AV_CODEC_ID_AAC)
 +                st->need_parsing = AVSTREAM_PARSE_FULL;
          }
  
 -        bytestream2_skip(&p, 4);    /* useless size field */
 -
 +        size        = bytestream2_get_le32(&p);
 +        size        = FFMIN(size, os->psize);
          time_unit   = bytestream2_get_le64(&p);
          spu         = bytestream2_get_le64(&p);
+         if (!time_unit || !spu) {
+             av_log(s, AV_LOG_ERROR, "Invalid timing values.\n");
+             return AVERROR_INVALIDDATA;
+         }
          bytestream2_skip(&p, 4);    /* default_len */
          bytestream2_skip(&p, 8);    /* buffersize + bits_per_sample */
  
@@@ -59,16 -57,10 +59,19 @@@ int64_t av_gcd(int64_t a, int64_t b)
  
  int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
      int64_t r=0;
 +    av_assert2(c > 0);
 +    av_assert2(b >=0);
 +    av_assert2((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4);
  
 -    if (c <= 0 || b < 0 || rnd == 4 || rnd > 5)
++    if (c <= 0 || b < 0 || !((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4))
+         return INT64_MIN;
 +    if (rnd & AV_ROUND_PASS_MINMAX) {
 +        if (a == INT64_MIN || a == INT64_MAX)
 +            return a;
 +        rnd -= AV_ROUND_PASS_MINMAX;
 +    }
 +
      if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
  
      if(rnd==AV_ROUND_NEAR_INF) r= c/2;