aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mtv.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2010-03-02 21:32:56 +0000
committerVitor Sessak <vitor1001@gmail.com>2010-03-02 21:32:56 +0000
commit5eef7bcd09ab1f73df6c70923dfa3f4ccd5b4190 (patch)
treeb761d239e9d63ed90351b184aa859f46c8690114 /libavformat/mtv.c
parent38beab19ab3b997bcbe2e95699d4952922f1f673 (diff)
downloadffmpeg-5eef7bcd09ab1f73df6c70923dfa3f4ccd5b4190.tar.gz
Plug memory leak for truncated files
Originally committed as revision 22154 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mtv.c')
-rw-r--r--libavformat/mtv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 8d08b792f1..e7e3a1c4bc 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -168,8 +168,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
url_fskip(pb, MTV_AUDIO_PADDING_SIZE);
ret = av_get_packet(pb, pkt, MTV_ASUBCHUNK_DATA_SIZE);
- if(ret != MTV_ASUBCHUNK_DATA_SIZE)
- return AVERROR(EIO);
+ if(ret < 0)
+ return ret;
pkt->pos -= MTV_AUDIO_PADDING_SIZE;
pkt->stream_index = AUDIO_SID;
@@ -177,8 +177,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
}else
{
ret = av_get_packet(pb, pkt, mtv->img_segment_size);
- if(ret != mtv->img_segment_size)
- return AVERROR(EIO);
+ if(ret < 0)
+ return ret;
#if !HAVE_BIGENDIAN