[FFmpeg-devel] [PATCH 2/2] avformat/rpl: check av_get_packet() for failure

Paul B Mahol onemda at gmail.com
Thu Feb 5 16:08:17 CET 2015


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavformat/rpl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index c1229e8..a05bff1 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -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);
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list