]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Mar 2012 00:21:16 +0000 (01:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Mar 2012 00:27:10 +0000 (01:27 +0100)
* qatar/master:
  h264: stricter reference limit enforcement.
  h264: increase reference poc list from 16 to 32.
  xa_adpcm: limit filter to prevent xa_adpcm_table[] array bounds overruns.
  snow: check reference frame indices.
  snow: reject unsupported chroma shifts.
  Add ffvhuff encoding and decoding regression test
  anm: convert to bytestream2 API
  bytestream: add more unchecked variants for bytestream2 API
  jvdec: unbreak video decoding
  jv demux: set video stream duration
  fate: add pam image regression test

Conflicts:
libavcodec/adpcm.c
libavcodec/anm.c
libavcodec/h264.c
libavcodec/mpegvideo.h
libavcodec/snowdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/adpcm.c
libavcodec/anm.c
libavcodec/bytestream.h
libavcodec/h264.c
libavcodec/jvdec.c
libavcodec/snowdec.c
libavformat/jvdec.c
tests/codec-regression.sh
tests/lavf-regression.sh
tests/ref/vsynth1/ffvhuff
tests/ref/vsynth2/ffvhuff

index 559eb293cef7f9ebbb35bee8340fa4fc1bd85b89,54c3e6d1941bac9ee75cd7a77d899dd4167e614e..dec23a37e4d8c04fbb8323f97d21d24e5c11451f
@@@ -277,9 -278,11 +278,9 @@@ static int xa_decode(AVCodecContext *av
  
          shift  = 12 - (in[4+i*2] & 15);
          filter = in[4+i*2] >> 4;
 -        if (filter > 4) {
 -            av_log(avctx, AV_LOG_ERROR,
 -                   "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
 -                   filter);
 -            return AVERROR_INVALIDDATA;
 +        if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) {
-             av_log_ask_for_sample(NULL, "unknown filter %d\n", filter);
++            av_log_ask_for_sample(avctx, "unknown XA-ADPCM filter %d\n", filter);
 +            filter=0;
          }
          f0 = xa_adpcm_table[filter][0];
          f1 = xa_adpcm_table[filter][1];
  
          shift  = 12 - (in[5+i*2] & 15);
          filter = in[5+i*2] >> 4;
 -        if (filter > 4) {
 -            av_log(avctx, AV_LOG_ERROR,
 -                   "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
 -                   filter);
 -            return AVERROR_INVALIDDATA;
 +        if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) {
-             av_log_ask_for_sample(NULL, "unknown filter %d\n", filter);
++            av_log_ask_for_sample(avctx, "unknown XA-ADPCM filter %d\n", filter);
 +            filter=0;
          }
 +
          f0 = xa_adpcm_table[filter][0];
          f1 = xa_adpcm_table[filter][1];
  
index 5493be6842ba80214fa028703094302ab5841cf5,c2d22cb3662c4f0457d3b74c59b5d33d31d289a4..37cd87012677931a82bfdfe6a6c769f0b06cc0aa
@@@ -41,15 -41,14 +41,15 @@@ static av_cold int decode_init(AVCodecC
  
      avctx->pix_fmt = PIX_FMT_PAL8;
  
-     if (avctx->extradata_size != 16*8 + 4*256)
-         return -1;
 -    s->frame.reference = 1;
 +    avcodec_get_frame_defaults(&s->frame);
 +    s->frame.reference = 3;
+     bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
+     if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256)
+         return -1;
  
-     buf = avctx->extradata + 16*8;
+     bytestream2_skipu(&s->gb, 16 * 8);
      for (i = 0; i < 256; i++)
-         s->palette[i] = bytestream_get_le32(&buf);
+         s->palette[i] = bytestream2_get_le32u(&s->gb);
  
      return 0;
  }
Simple merge
index 2cb56028de30df26e57d592dc37706fc4e4cb4c4,64f676c4a92d83cd0ec696893255f991b170ec8d..66174778df67f1f946b1f217c1bbcb2a64748691
@@@ -3034,7 -3021,8 +3034,8 @@@ static int decode_slice_header(H264Cont
      h->ref_count[1]= h->pps.ref_count[1];
  
      if(h->slice_type_nos != AV_PICTURE_TYPE_I){
-         unsigned max= (16<<(s->picture_structure != PICT_FRAME))-1;
 -        int max_refs = s->picture_structure == PICT_FRAME ? 16 : 32;
++        unsigned max= s->picture_structure == PICT_FRAME ? 15 : 31;
          if(h->slice_type_nos == AV_PICTURE_TYPE_B){
              h->direct_spatial_mv_pred= get_bits1(&s->gb);
          }
              h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
              if(h->slice_type_nos==AV_PICTURE_TYPE_B)
                  h->ref_count[1]= get_ue_golomb(&s->gb) + 1;
          }
-         if(h->ref_count[0]-1 > max || h->ref_count[1]-1 > max){
 -        if (h->ref_count[0] > max_refs || h->ref_count[1] > max_refs) {
++        if (h->ref_count[0]-1 > max || h->ref_count[1]-1 > max){
              av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow\n");
-             h->ref_count[0]= h->ref_count[1]= 1;
-             return -1;
+             h->ref_count[0] = h->ref_count[1] = 1;
+             return AVERROR_INVALIDDATA;
          }
          if(h->slice_type_nos == AV_PICTURE_TYPE_B)
              h->list_count= 2;
          else
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000000000000000000000000000000000000,4a1ebdb1a359d6a15fc0d928ef5bca1591e1a00c..c6d7627b24371ab97f9d2a79ac76a7e1cbbbd71d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,4 +1,4 @@@
 -da0c0bd12ac141c976ffa6a71832ab4b *./tests/data/vsynth1/ffvhuff.avi
++0632ffae6f1e06dd299bf41a845b9099 *./tests/data/vsynth1/ffvhuff.avi
+  5987208 ./tests/data/vsynth1/ffvhuff.avi
+ c5ccac874dbf808e9088bc3107860042 *./tests/data/ffvhuff.vsynth1.out.yuv
+ stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
index 0000000000000000000000000000000000000000,47fc6597d774da4dd600ff760914d66a7c170afa..6d77e2a027439f0b749b4bdf6378cbf377526f1d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,4 +1,4 @@@
 -d31aab445b24f738df45fdd7479d6dd7 *./tests/data/vsynth2/ffvhuff.avi
++63926d8835dd5779dca0a4bc081ca8ae *./tests/data/vsynth2/ffvhuff.avi
+  4988056 ./tests/data/vsynth2/ffvhuff.avi
+ dde5895817ad9d219f79a52d0bdfb001 *./tests/data/ffvhuff.vsynth2.out.yuv
+ stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200