[FFmpeg-devel] Found Two Mem Leaks. Fix Ok.

Michel Bardiaux mbardiaux
Wed Jul 4 17:11:07 CEST 2007


Oliver Pfister wrote:
> Hi,
> 
> I found two mem. leaks, I tested the fix, it works:
> 
> 1. In ffv1.c
> ------------
> 
> static int common_end(AVCodecContext *avctx){
>     FFV1Context *s = avctx->priv_data;
>     int i;
> 
>     for(i=0; i<s->plane_count; i++){
>         PlaneContext *p= &s->plane[i];
> 
>         av_freep(&p->state);
> 	  av_freep(&p->vlc_state); // Add this line!!!!!!!
>     }
> 
>     return 0;
> }
> 
> 2. In huffyuv.c
> ---------------
> 
> static int decode_end(AVCodecContext *avctx){
>     HYuvContext *s = avctx->priv_data;
>     int i;
> 
>     common_end(s);
>     av_freep(&s->bitstream_buffer);
> 
>     for(i=0; i<6; i++){ // Change from 3 to 6 !!!!!!!!!!
>         free_vlc(&s->vlc[i]);
>     }
> 
>     return 0;
> }
> 
The proper way is to attach a patch file (svn diff), and mention [PATCH] 
in the Subject line. Otherwise, it probably wont be reviewed by the 
usual reviewers (which I am not)

And "it works" is no good. Run the regression tests.

Greetings,
-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/




More information about the ffmpeg-devel mailing list