[SCM] libav/experimental: Check if buffer is large enough for given resolution. Fixes issue 2501.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:21:32 UTC 2013


The following commit has been merged in the experimental branch:
commit f2953365d1c1da8c1e586270c6eb2c7437c77a9f
Author: Daniel Kang <daniel.d.kang at gmail.com>
Date:   Fri Jan 7 21:54:52 2011 +0000

    Check if buffer is large enough for given resolution.
    Fixes issue 2501.
    
    Patch by Daniel Kang, daniel.d.kang at gmail
    
    Originally committed as revision 26258 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c
index 47809c0..96c9bdf 100644
--- a/libavcodec/cljr.c
+++ b/libavcodec/cljr.c
@@ -54,6 +54,11 @@ static int decode_frame(AVCodecContext *avctx,
     if(p->data[0])
         avctx->release_buffer(avctx, p);
 
+    if(buf_size/avctx->height < avctx->width) {
+        av_log(avctx, AV_LOG_ERROR, "Resolution larger than buffer size. Invalid header?\n");
+        return -1;
+    }
+
     p->reference= 0;
     if(avctx->get_buffer(avctx, p) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list