Commit a202cebf authored by michael's avatar michael

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

fixes CID84 RUN2


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13495 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 66ce3698
......@@ -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 */
......
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