summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-13 01:12:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-13 01:13:07 +0100
commitd8a1eb11b72071ba88946191f8bc9701167d39a6 (patch)
tree347f268a11f56c76affd6ddd03c195b873ccca7c
parent580021cfc45847d9d0fbbbfe4045c40cc56924bf (diff)
wavpack: check the blocks sample count, fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wavpack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index b36fa0a28e..bc038a9534 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -806,6 +806,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
*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;
}