1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit 'ed50673066956d6f2201a57c3254569f2ab08d9d'

* commit 'ed50673066956d6f2201a57c3254569f2ab08d9d':
  wavpack: validate samples size parsed in wavpack_decode_block

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-05-19 10:27:11 +02:00
commit 3e3514bce2

View File

@ -807,14 +807,15 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
if (!wc->mkv_mode) {
s->samples = AV_RL32(buf);
buf += 4;
if (s->samples != wc->samples) {
av_log(avctx, AV_LOG_ERROR, "mismatching sample count in block");
return AVERROR_INVALIDDATA;
}
if (!s->samples) {
*got_frame_ptr = 0;
return 0;
}
if (s->samples > wc->samples) {
av_log(avctx, AV_LOG_ERROR, "too many samples in block");
return -1;
}
} else {
s->samples = wc->samples;
}