[SCM] libav/experimental: Check for memory allocation failure of temp buffer

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:09:36 UTC 2013


The following commit has been merged in the experimental branch:
commit 52537534d20c675d3c53cdad160dd3462fbfef30
Author: Roberto Togni <r_togni at tiscali.it>
Date:   Sun Nov 18 22:49:41 2007 +0000

    Check for memory allocation failure of temp buffer
    
    Originally committed as revision 11053 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 8793487..4fef4cd 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -495,7 +495,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *
     if((seq & 0x7F) == 1 || rm->curpic_num != pic_num){
         rm->slices = ((hdr & 0x3F) << 1) + 1;
         ssize = len2 + 8*rm->slices + 1;
-        rm->videobuf = av_realloc(rm->videobuf, ssize);
+        if(!(rm->videobuf = av_realloc(rm->videobuf, ssize)))
+            return AVERROR(ENOMEM);
         rm->videobufsize = ssize;
         rm->videobufpos = 8*rm->slices + 1;
         rm->cur_slice = 0;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list