Commit d4fb077f authored by vitor's avatar vitor

Plug memory leak for truncated files


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22154 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 339ccbaf
...@@ -168,8 +168,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -168,8 +168,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
url_fskip(pb, MTV_AUDIO_PADDING_SIZE); url_fskip(pb, MTV_AUDIO_PADDING_SIZE);
ret = av_get_packet(pb, pkt, MTV_ASUBCHUNK_DATA_SIZE); ret = av_get_packet(pb, pkt, MTV_ASUBCHUNK_DATA_SIZE);
if(ret != MTV_ASUBCHUNK_DATA_SIZE) if(ret < 0)
return AVERROR(EIO); return ret;
pkt->pos -= MTV_AUDIO_PADDING_SIZE; pkt->pos -= MTV_AUDIO_PADDING_SIZE;
pkt->stream_index = AUDIO_SID; pkt->stream_index = AUDIO_SID;
...@@ -177,8 +177,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -177,8 +177,8 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
}else }else
{ {
ret = av_get_packet(pb, pkt, mtv->img_segment_size); ret = av_get_packet(pb, pkt, mtv->img_segment_size);
if(ret != mtv->img_segment_size) if(ret < 0)
return AVERROR(EIO); return ret;
#if !HAVE_BIGENDIAN #if !HAVE_BIGENDIAN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment