Browse Source

wavpack: check that there aren't too many blocks per packet

tags/n2.0
Anton Khirnov 12 years ago
parent
commit
eae1b8451a
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/wavpack.c

+ 5
- 0
libavcodec/wavpack.c View File

@@ -1120,6 +1120,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
}
}

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];


Loading…
Cancel
Save