[FFmpeg-cvslog] r11053 - trunk/libavformat/rmdec.c

Michael Niedermayer michaelni
Mon Nov 19 02:31:24 CET 2007


On Sun, Nov 18, 2007 at 11:49:42PM +0100, rtogni wrote:
> Author: rtogni
> Date: Sun Nov 18 23:49:41 2007
> New Revision: 11053
> 
> Log:
> Check for memory allocation failure of temp buffer
> 
> 
> Modified:
>    trunk/libavformat/rmdec.c
> 
> Modified: trunk/libavformat/rmdec.c
> ==============================================================================
> --- trunk/libavformat/rmdec.c	(original)
> +++ trunk/libavformat/rmdec.c	Sun Nov 18 23:49:41 2007
> @@ -495,7 +495,8 @@ static int rm_assemble_video_frame(AVFor
>      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);

looks like a memleak
if realloc fails the original is not freed IIRC


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Thouse who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20071119/d1136eec/attachment.pgp>



More information about the ffmpeg-cvslog mailing list