Skip to content

Commit

Permalink
mxfdec: fix memleak on read error/EOF.
Browse files Browse the repository at this point in the history
This also matches the rest of the demuxer which will return
partial packets.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
  • Loading branch information
rdoeffinger committed Apr 20, 2012
1 parent 4a80ebe commit dd5e1fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavformat/mxfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,8 +2118,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 ((size = av_get_packet(s->pb, pkt, size)) < 0)
return size;

if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && t->ptses &&
mxf->current_edit_unit >= 0 && mxf->current_edit_unit < t->nb_ptses) {
Expand Down

0 comments on commit dd5e1fc

Please sign in to comment.