[FFmpeg-devel] [PATCH] swscale-example: use av_malloc()

Michael Niedermayer michaelni
Tue Jan 19 16:33:47 CET 2010


On Tue, Jan 19, 2010 at 08:25:40AM -0200, Ramiro Polla wrote:
> 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 [1]:
> "seriously, example code should be simple and useage of av_free* may not be
> for someone unfamiliar with libav* development"

good argument but without rereading the thread, id suspect that was for a
"change to avmalloc() due to consistency or so" here its a crash due to
insufficient alignment on ppc
same change but different reason for the change


> 
> 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) */

ok

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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100119/dadb3ede/attachment.pgp>



More information about the ffmpeg-devel mailing list