diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-07 12:06:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-07 13:16:32 +0100 |
commit | c188f358aaee5800af5a5d699dd657cef3fb43a6 (patch) | |
tree | 2f2382833d88bd117b9659ababbd0e2b22632757 /libavcodec/wavpack.c | |
parent | 6b95da9af91cd912561aa25593d6a41caa071963 (diff) | |
download | ffmpeg-c188f358aaee5800af5a5d699dd657cef3fb43a6.tar.gz |
avcodec/wavpack: Treat the first block coding too many channels as an error
Fixes memleak
Fixes: 236/8aeebc9ca49b91bf71c114dcefac56c154a3a563
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 071e2be72c..2bd77835b4 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1016,7 +1016,7 @@ 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; + return ((avctx->err_recognition & AV_EF_EXPLODE) || !wc->ch_offset) ? AVERROR_INVALIDDATA : 0; } samples_l = frame->extended_data[wc->ch_offset]; |