[FFmpeg-devel] [PATCH v3] lavf/h264: add support for h264 video from Arecont camera, fixes ticket #5154

Moritz Barsnick barsnick at gmx.net
Thu May 9 12:30:28 EEST 2019


On Thu, May 09, 2019 at 07:28:20 +0530, Shivam Goyal wrote:
> >> +    //Extra to find the http header
> >> +    size = 2 * ARECONT_H264_MIME_SIZE + RAW_PACKET_SIZE;
> >> +    data = av_malloc(size);
> >> +
> >> +    if (av_new_packet(pkt, size) < 0)
> >> +        return AVERROR(ENOMEM);
> >
> > memleak on error
>
> I have tested this on the file attached to the ticket, the error didn't
> came. Please, could you tell me how to solve this error and why it came.

It's a hypothetical case. You can see the memleak by code review,
without the need for actually reproducing it with a real world test.

You need to clean up your allocated memory in error paths as well.
Please see many other places in the ffmpeg code.

Moritz


More information about the ffmpeg-devel mailing list