diff options
author | Reinhard Tartler <siretart@tauware.de> | 2013-12-08 13:24:26 -0500 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-12-14 14:30:24 -0500 |
commit | d4a24e43edd0c1a06d5dbf454448fde5b3d1d281 (patch) | |
tree | 01935967d7ba9ad80691a08854f99c9a426ad5cb /libavcodec | |
parent | ae9652605a9a3328d3f992925a37bde037dff2ee (diff) | |
download | ffmpeg-d4a24e43edd0c1a06d5dbf454448fde5b3d1d281.tar.gz |
alsdec: check block length
Fix writing over the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Addresses: CVE-2013-0845
(cherry picked from commit 2a0fb7286d67c47e44aa76c237ede117b22af616)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 3f7d89034bfe50893927cc92ddcb95a2e9b4178d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alsdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index b0369d7f4e..7daa545765 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1386,6 +1386,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; |