Browse Source

ape: check avio_read() return value

This sets pkt->size to absurd values on failure otherwise.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
wm4 Michael Niedermayer 12 years ago
parent
commit
a5ef7960fc
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/ape.c

+ 2
- 0
libavformat/ape.c View 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;


Loading…
Cancel
Save