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

Ramiro Polla ramiro86
Sun Aug 20 17:20:30 CEST 2006


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?

Thanks,
Ramiro Polla






More information about the ffmpeg-devel mailing list