summaryrefslogtreecommitdiff
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2013-12-08 13:24:26 -0500
committerReinhard Tartler <siretart@tauware.de>2013-12-10 07:21:40 -0500
commit2a0fb7286d67c47e44aa76c237ede117b22af616 (patch)
tree5c754de0c46c1694869a19077a710ff6f7d23a64 /libavcodec/alsdec.c
parent1a5fdf9519d7f4b9a1bdda623516c37744f569bd (diff)
alsdec: check block length
Fix writing over the end Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Addresses: CVE-2013-0845
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 782a1b8b80..f7dee7de12 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1376,6 +1376,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
for (b = 0; b < ctx->num_blocks; b++) {
bd.block_length = div_blocks[b];
+ if (bd.block_length <= 0) {
+ av_log(ctx->avctx, AV_LOG_WARNING,
+ "Invalid block length %d in channel data!\n", bd.block_length);
+ continue;
+ }
for (c = 0; c < avctx->channels; c++) {
bd.const_block = ctx->const_block + c;