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

Paul B Mahol onemda at gmail.com
Tue Jun 19 14:15:29 CEST 2012


On 6/19/12, Stefano Sabatini <stefasab at gmail.com> wrote:
> 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.

LGTM


More information about the ffmpeg-devel mailing list