[FFmpeg-devel] [PATCH] swscale-example: use av_malloc()
Tue Jan 19 11:25:40 CET 2010
On Tue, Jan 19, 2010 at 1:07 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Tue, Jan 19, 2010 at 02:20:02AM +0000, Mans Rullgard wrote:
>> Image buffers require 16-byte alignment, so av_malloc() should be used.
>> Fixes crash on PPC.
>> ?swscale-example.c | ? 11 ++++++-----
>> ?1 files changed, 6 insertions(+), 5 deletions(-)
> ok with matching av_free()
Quoting you from :
"seriously, example code should be simple and useage of av_free* may not be
for someone unfamiliar with libav* development"
So maybe we should have a similar comment like we have on output-example:
/* image buffers passed into libswscale can be allocated any
way you prefer,
as long as they're aligned enough for the architecture, and
they're freed appropriately (such as using av_free for buffers
allocated with av_malloc) */
More information about the ffmpeg-devel