Merge commit '89806691b1c39181c63d95e0fddc30f11e2a7b04'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 29 May 2013 02:44:53 +0000 (04:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 29 May 2013 03:01:35 +0000 (05:01 +0200)
* commit '89806691b1c39181c63d95e0fddc30f11e2a7b04':
  wavpack: check that all the channels were coded.
  wavpack: check that there aren't too many blocks per packet

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

@@@ -1129,9 -1118,13 +1124,14 @@@ static int wavpack_decode_block(AVCodec
              av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
              return ret;
          }
 +        frame->nb_samples = s->samples;
      }
  
+     if (wc->ch_offset + s->stereo >= avctx->channels) {
+         av_log(avctx, AV_LOG_WARNING, "Too many channels coded in a packet.\n");
+         return (avctx->err_recognition & AV_EF_EXPLODE) ? AVERROR_INVALIDDATA : 0;
+     }
      samples_l = frame->extended_data[wc->ch_offset];
      if (s->stereo)
          samples_r = frame->extended_data[wc->ch_offset + 1];