[FFmpeg-devel] [PATCH] Fix unaligned dsputil call in pngdec.c

Reimar Döffinger Reimar.Doeffinger
Sat May 23 17:49:29 CEST 2009


On Sat, May 23, 2009 at 05:46:07PM +0200, Reimar D?ffinger wrote:
> On Sat, May 23, 2009 at 05:32:10PM +0200, Vitor Sessak wrote:
> > @@ -612,7 +613,7 @@
> >      ret = s->bytestream - s->bytestream_start;
> >   the_end:
> >      inflateEnd(&s->zstream);
> > -    av_freep(&s->crow_buf);
> > +    av_freep(&s->crow_buf - 15);
> 
> still won't do what you want at all, I recommend testing with valgrind.
> Might be best to decrement crwo_buf first.

Of course after checking that it is !NULL first. I think that's going to
become a mess, maybe split the variable, making crow_buf_base the
malloced one, i.e.
crow_buf_base = av_malloc
if (!crow_buf_base) ...
crow_buf = crow_buf_base + 15;

av_freep(&crow_buf_base);
crow_buf = NULL;



More information about the ffmpeg-devel mailing list