summaryrefslogtreecommitdiff
path: root/libavcodec/wavpack.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-28 00:23:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-28 00:54:45 +0100
commitc6831e2a70f734c71f483d69d46d0635963530c7 (patch)
tree77a88bbd80384726dc484933c1a8b1757742bf60 /libavcodec/wavpack.c
parent81e85bc95cb1e4f8cc7b1ba71ec027c8791b55d1 (diff)
wavpack: check K, fix assertion failure
Instead of this it would be possible to change the code to support larger K but that would make the code slower and probably still need checks on K. This variant is choosen as there are no known valid files that need larger K Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r--libavcodec/wavpack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index b30b41414b..481d323bc4 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -373,6 +373,10 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
INC_MED(2);
}
if (!c->error_limit) {
+ if (add >= 0x2000000U) {
+ av_log(ctx->avctx, AV_LOG_ERROR, "k %d is too large\n", add);
+ goto error;
+ }
ret = base + get_tail(gb, add);
if (get_bits_left(gb) <= 0)
goto error;