[FFmpeg-cvslog] avformat/rmdec: Check the return value of av_get_packet()

Michael Niedermayer git at videolan.org
Sun Jan 18 21:07:16 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 18 20:55:49 2015 +0100| [65b83ce01b94eae944290c11257799a9288f2d4c] | committer: Michael Niedermayer

avformat/rmdec: Check the return value of av_get_packet()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65b83ce01b94eae944290c11257799a9288f2d4c
---

 libavformat/rmdec.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index d61e327..9418848 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -896,11 +896,14 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
             } else
                 return -1;
         } else {
-            av_get_packet(pb, pkt, len);
+            if ((ret = av_get_packet(pb, pkt, len)) < 0)
+                return ret;
             rm_ac3_swap_bytes(st, pkt);
         }
-    } else
-        av_get_packet(pb, pkt, len);
+    } else {
+        if ((ret = av_get_packet(pb, pkt, len)) < 0)
+            return ret;
+    }
 
     pkt->stream_index = st->index;
 
@@ -933,9 +936,11 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
     av_assert0 (rm->audio_pkt_cnt > 0);
 
     if (ast->deint_id == DEINT_ID_VBRF ||
-        ast->deint_id == DEINT_ID_VBRS)
-        av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
-    else {
+        ast->deint_id == DEINT_ID_VBRS) {
+        int ret = av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
+        if (ret < 0)
+            return ret;
+    } else {
         int ret = av_new_packet(pkt, st->codec->block_align);
         if (ret < 0)
             return ret;



More information about the ffmpeg-cvslog mailing list