diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-02-05 14:44:43 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-02-06 16:07:16 +0000 |
commit | f968166439e4d4fc9f352ea20b8922d42ca5c7b1 (patch) | |
tree | ccb16638138c3255167b78ff77fc8757255a0bff /libavformat | |
parent | 6fafc62b0bd0e206deb77a7aabbf3a370ad80789 (diff) | |
download | ffmpeg-f968166439e4d4fc9f352ea20b8922d42ca5c7b1.tar.gz |
avformat/rpl: check av_get_packet() for failure
Also make ret signed as it should be from start.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rpl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c index c1229e85eb..04cb917aef 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -278,7 +278,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) AVIOContext *pb = s->pb; AVStream* stream; AVIndexEntry* index_entry; - uint32_t ret; + int ret; if (rpl->chunk_part == s->nb_streams) { rpl->chunk_number++; @@ -308,6 +308,8 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(EIO); ret = av_get_packet(pb, pkt, frame_size); + if (ret < 0) + return ret; if (ret != frame_size) { av_free_packet(pkt); return AVERROR(EIO); @@ -323,6 +325,8 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) } } else { ret = av_get_packet(pb, pkt, index_entry->size); + if (ret < 0) + return ret; if (ret != index_entry->size) { av_free_packet(pkt); return AVERROR(EIO); |