[FFmpeg-devel] [PATCH] lavc/libshroedinger: add missing failure checks in ff_create_shro_frame()

Stefano Sabatini stefasab at gmail.com
Tue Jun 19 13:48:08 CEST 2012


On date Tuesday 2012-06-19 11:16:42 +0000, Paul B Mahol encoded:
> On 6/19/12, Stefano Sabatini <stefasab at gmail.com> wrote:
> > ---
> >  libavcodec/libschroedinger.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavcodec/libschroedinger.c b/libavcodec/libschroedinger.c
> > index 631035e..6ae2adc 100644
> > --- a/libavcodec/libschroedinger.c
> > +++ b/libavcodec/libschroedinger.c
> > @@ -189,7 +189,8 @@ SchroFrame *ff_create_schro_frame(AVCodecContext
> > *avccontext,
> >      uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
> >
> >      p_pic = av_mallocz(sizeof(AVPicture));
> > -    avpicture_alloc(p_pic, avccontext->pix_fmt, y_width, y_height);
> > +    if (!p_pic || avpicture_alloc(p_pic, avccontext->pix_fmt, y_width,
> > y_height) < 0)
> > +        return NULL;
> 
> Memory leak.

Yes, thanks for spotting. Fixed a few typos in log.
-- 
FFmpeg = Fancy and Faithful Mortal Pure Ecumenical Gadget
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-lavc-libschroedinger-add-missing-failure-checks-in-f.patch
Type: text/x-diff
Size: 1034 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120619/9ab2e9df/attachment.bin>


More information about the ffmpeg-devel mailing list