Commit 149a9ddb authored by vitor's avatar vitor

Fix memory leak for truncated packets in idCin demuxer


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21938 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7ef397c6
...@@ -260,8 +260,8 @@ static int idcin_read_packet(AVFormatContext *s, ...@@ -260,8 +260,8 @@ static int idcin_read_packet(AVFormatContext *s,
url_fseek(pb, 4, SEEK_CUR); url_fseek(pb, 4, SEEK_CUR);
chunk_size -= 4; chunk_size -= 4;
ret= av_get_packet(pb, pkt, chunk_size); ret= av_get_packet(pb, pkt, chunk_size);
if (ret != chunk_size) if (ret < 0)
return AVERROR(EIO); return ret;
pkt->stream_index = idcin->video_stream_index; pkt->stream_index = idcin->video_stream_index;
pkt->pts = idcin->pts; pkt->pts = idcin->pts;
} else { } else {
...@@ -271,8 +271,8 @@ static int idcin_read_packet(AVFormatContext *s, ...@@ -271,8 +271,8 @@ static int idcin_read_packet(AVFormatContext *s,
else else
chunk_size = idcin->audio_chunk_size1; chunk_size = idcin->audio_chunk_size1;
ret= av_get_packet(pb, pkt, chunk_size); ret= av_get_packet(pb, pkt, chunk_size);
if (ret != chunk_size) if (ret < 0)
return AVERROR(EIO); return ret;
pkt->stream_index = idcin->audio_stream_index; pkt->stream_index = idcin->audio_stream_index;
pkt->pts = idcin->pts; pkt->pts = idcin->pts;
......
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