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
This commit is contained in:
Michael Niedermayer 2008-05-28 11:59:41 +00:00
parent e5f6b7e5ac
commit 909a9ad08d

View File

@ -158,6 +158,12 @@ static int adpcm_encode_init(AVCodecContext *avctx)
{
if (avctx->channels > 2)
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) {
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 */