Commit 909a9ad0 authored by Michael Niedermayer's avatar Michael Niedermayer

Prevent 128*1<<trellis from becoming 0 and creating 0 sized arrays.

fixes CID84 RUN2
      CID85 RUN2
      CID86 RUN2
      CID87 RUN2
      CID88 RUN2
      CID89 RUN2
      CID90 RUN2
      CID91 RUN2
      CID92 RUN2
      CID93 RUN2
      CID94 RUN2
      CID95 RUN2
      CID96 RUN2
      CID97 RUN2
      CID98 RUN2
      CID99 RUN2
      CID100 RUN2
      CID101 RUN2
      CID102 RUN2
      CID103 RUN2
      CID104 RUN2
      CID105 RUN2
      CID106 RUN2

Originally committed as revision 13495 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent e5f6b7e5
...@@ -158,6 +158,12 @@ static int adpcm_encode_init(AVCodecContext *avctx) ...@@ -158,6 +158,12 @@ static int adpcm_encode_init(AVCodecContext *avctx)
{ {
if (avctx->channels > 2) if (avctx->channels > 2)
return -1; /* only stereo or mono =) */ return -1; /* only stereo or mono =) */
if(avctx->trellis && (unsigned)avctx->trellis > 16U){
av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
return -1;
}
switch(avctx->codec->id) { switch(avctx->codec->id) {
case CODEC_ID_ADPCM_IMA_WAV: case CODEC_ID_ADPCM_IMA_WAV:
avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */ avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment