Hi, On Sat, Jan 28, 2012 at 9:19 AM, Justin Ruggles <[email protected]> wrote: > On 01/26/2012 09:26 PM, Paul B Mahol wrote: > >> Signed-off-by: Paul B Mahol <[email protected]> >> --- >> libavcodec/ac3enc.c | 2 ++ >> libavcodec/adpcmenc.c | 3 +++ >> libavcodec/adxenc.c | 2 ++ >> libavcodec/alacenc.c | 3 +++ >> libavcodec/libfaac.c | 3 +++ >> libavcodec/libgsm.c | 3 +++ >> libavcodec/libmp3lame.c | 3 +++ >> libavcodec/libopencore-amr.c | 2 ++ >> libavcodec/libtheoraenc.c | 2 ++ >> libavcodec/libvo-aacenc.c | 3 +++ >> libavcodec/libvo-amrwbenc.c | 2 ++ >> libavcodec/libvorbis.c | 3 +++ >> libavcodec/mpegaudioenc.c | 3 +++ >> libavcodec/pcm.c | 3 +++ >> libavcodec/r210dec.c | 2 ++ >> libavcodec/roqaudioenc.c | 3 +++ >> libavcodec/v210dec.c | 2 ++ >> libavcodec/v210enc.c | 2 ++ >> libavcodec/v210x.c | 2 ++ >> libavcodec/vorbisenc.c | 3 +++ >> 20 files changed, 51 insertions(+), 0 deletions(-) > > > Many of these codecs allocate other things prior to calling > avcodec_alloc_frame(), so if the allocation fails, the previously > allocated memory needs to be freed as well to avoid a memleak. Moving > this allocation to the top of the init() function would probably > simplify the error handling in those cases.
goto error is the only allowed goto, and can be very useful for these cases... Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
