[FFmpeg-cvslog] ape: check avio_read() return value
wm4
git at videolan.org
Sun Aug 11 21:54:30 CEST 2013
ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Sun Aug 11 17:40:33 2013 +0200| [a5ef7960fc96ed773acc4149104d6acf534e8a87] | committer: Michael Niedermayer
ape: check avio_read() return value
This sets pkt->size to absurd values on failure otherwise.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5ef7960fc96ed773acc4149104d6acf534e8a87
---
libavformat/ape.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/ape.c b/libavformat/ape.c
index e2b8ada..bb61a24 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -414,6 +414,8 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
AV_WL32(pkt->data , nblocks);
AV_WL32(pkt->data + 4, ape->frames[ape->currentframe].skip);
ret = avio_read(s->pb, pkt->data + extra_size, ape->frames[ape->currentframe].size);
+ if (ret < 0)
+ return ret;
pkt->pts = ape->frames[ape->currentframe].pts;
pkt->stream_index = 0;
More information about the ffmpeg-cvslog
mailing list