[FFmpeg-devel] Memory allocation failure

Michael Niedermayer michaelni
Mon Sep 14 01:09:58 CEST 2009


On Sat, Sep 12, 2009 at 03:05:06PM -0300, Ramiro Polla wrote:
> On Sun, Sep 6, 2009 at 6:52 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sat, Sep 05, 2009 at 11:41:18PM -0300, Ramiro Polla wrote:
> >> Hi,
> >>
> >> While testing some memory allocation failures I thought about checking
> >> how far FFmpeg goes without segfaulting when some av_malloc() call
> >> fails.
> >>
> >> With malloc_errors_test.diff I tested from 1 up to 127 and then got
> >> bored. In malloc_errors.diff there are the changes I was making. Some
> >> were trivial, some I didn't know what to do and just commented on.
> >> Thoroughly checking for malloc return value errors would take so long
> >> I gave up.
> >
> > feel free to commit what you are sure is correct
> > (for example a *exit() in ffmpeg.c cant be too wrong ...)
> 
> Committed some parts.
> 
> Attached patches are:
> add_to_pktbuf.diff is part of the previous patch but I'm not exactly
> sure it's the best way to go.
> alloc_context.diff checks for return value of
> av{codec,format}_alloc_context() throughout FFmpeg except for the
> contexts allocated for option handling in ffplay.c and ffmpeg.c (for
> now).
> alloc_frame.diff checks return value of all uses of avcodec_alloc_frame().

all the exits() in all applications should be ok ...

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20090914/45641e2d/attachment.pgp>



More information about the ffmpeg-devel mailing list