[FFmpeg-cvslog] alsdec: check block length

Reinhard Tartler git at videolan.org
Sat Dec 21 02:49:10 CET 2013


ffmpeg | branch: release/1.1 | Reinhard Tartler <siretart at tauware.de> | Sun Dec  8 13:24:26 2013 -0500| [3f7d89034bfe50893927cc92ddcb95a2e9b4178d] | committer: Reinhard Tartler

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 at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f7d89034bfe50893927cc92ddcb95a2e9b4178d
---

 libavcodec/alsdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index f1d01a2..cb942c2 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1380,6 +1380,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;



More information about the ffmpeg-cvslog mailing list