[Ffmpeg-devel] [PATCH] plain malloc in output_example.c

Michael Niedermayer michaelni
Sun Aug 20 19:32:57 CEST 2006


Hi

On Sun, Aug 20, 2006 at 12:20:30PM -0300, Ramiro Polla wrote:
> Hello,
> 
> Michael Niedermayer wrote:
> >Hi
> >
> >On Sun, Aug 20, 2006 at 12:00:14AM -0300, Ramiro Polla wrote:
> >
> >>Hello,
> >>
> >>Shouldn't output_example.c use av_malloc() instead of plain malloc()? It
> >>uses av_free(), so when --enable-memalign-hack is enabled, it allocates
> >>an unaligned buffer, and tries to free it with the memalign hack.
> >>
> >>Attached patch makes it work with --enable-memalign-hack.
> >>
> >
> >instead of changing several malloc() change one av_free()
> >
> Sorry if I don't really understand what you mean...
> Do you mean changing the calls from av_free() to free()? Every malloc()
> I changed to av_malloc() was freed with av_free() later on the program.
> >additionally thats not the only case in output_example.c where
> >malloc() and av_free() is mixed so unless you fix all, the
> >fix wont really fix anyhing
> >
> >
> Unless I really missed something, the patch fixes all occurences of
> malloc() in output_example.c. The executable file doesn't ever call the
> system's malloc directly anymore.
> Am I missing something?

nope, sorry ...
the original patch is ok if you add some note which says that the
buffers passed into lav* can be allocated any way the user likes
as long as they are aligned by enough for the architecture

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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list