ape: check avio_read() return value
authorwm4 <nfxjfg@googlemail.com>
Sun, 11 Aug 2013 15:40:33 +0000 (17:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 11 Aug 2013 19:46:09 +0000 (21:46 +0200)
This sets pkt->size to absurd values on failure otherwise.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/ape.c

index e2b8ada..bb61a24 100644 (file)
@@ -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;