Merge commit '613a37eca4c7b8eefceaa3e0231c23ad090ca94f'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Mar 2013 12:14:16 +0000 (13:14 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Mar 2013 12:14:16 +0000 (13:14 +0100)
* commit '613a37eca4c7b8eefceaa3e0231c23ad090ca94f':
  ape: 3.80-3.92 decoding support
  h264: Remove an unused variable

Conflicts:
libavcodec/apedec.c
libavformat/ape.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/apedec.c
libavformat/ape.c

@@@ -235,7 -247,8 +247,9 @@@ static av_cold int ape_decode_init(AVCo
  
      av_log(avctx, AV_LOG_DEBUG, "Compression Level: %d - Flags: %d\n",
             s->compression_level, s->flags);
-     if (s->compression_level % 1000 || s->compression_level > COMPRESSION_LEVEL_INSANE || !s->compression_level) {
+     if (s->compression_level % 1000 || s->compression_level > COMPRESSION_LEVEL_INSANE ||
++        !s->compression_level ||
+         (s->fileversion < 3930 && s->compression_level == COMPRESSION_LEVEL_INSANE)) {
          av_log(avctx, AV_LOG_ERROR, "Incorrect compression level %d\n",
                 s->compression_level);
          return AVERROR_INVALIDDATA;
@@@ -276,9 -285,13 +283,16 @@@ static int ape_read_header(AVFormatCont
              return AVERROR(ENOMEM);
          for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
              ape->seektable[i] = avio_rl32(pb);
+         if (ape->fileversion < 3810) {
+             ape->bittable = av_malloc(ape->totalframes);
+             if (!ape->bittable)
+                 return AVERROR(ENOMEM);
+             for (i = 0; i < ape->totalframes; i++)
+                 ape->bittable[i] = avio_r8(pb);
+         }
 +    }else{
 +        av_log(s, AV_LOG_ERROR, "Missing seektable\n");
 +        return AVERROR_INVALIDDATA;
      }
  
      ape->frames[0].pos     = ape->firstframe;