[FFmpeg-devel] [PATCH] mxfdec: fix memleak on read error/EOF.

Michael Niedermayer michaelni at gmx.at
Sun Apr 15 09:38:34 CEST 2012


On Thu, Apr 12, 2012 at 08:53:34PM +0200, Reimar Döffinger wrote:
> This also matches the rest of the demuxer which will return
> partial packets.
> 
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libavformat/mxfdec.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index 0782ffe..e5fb7f4 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -2119,8 +2119,8 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
>      if ((ret64 = avio_seek(s->pb, pos, SEEK_SET)) < 0)
>          return ret64;
>  
> -        if ((ret = av_get_packet(s->pb, pkt, size)) != size)
> -            return ret < 0 ? ret : AVERROR_EOF;
> +        if ((ret = av_get_packet(s->pb, pkt, size)) < 0)
> +            return ret;

i would update size for the case that some future change uses size
after this line

otherwise LGTM in case tomas/baptiste are busy


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120415/7fc9844d/attachment.asc>


More information about the ffmpeg-devel mailing list