[FFmpeg-cvslog] rmdec: check av_new_packet return value

Vittorio Giovara git at videolan.org
Sun Jan 18 01:09:33 CET 2015


ffmpeg | branch: release/2.4 | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Oct 20 14:11:17 2014 +0100| [4cd0041d38664adcb6f4b3038e277631b85d5dc8] | committer: Vittorio Giovara

rmdec: check av_new_packet return value

CC: libav-stable at libav.org
Bug-Id: CID 733714

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

 libavformat/rmdec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 848d031..dae1235 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -816,7 +816,9 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
         ast->deint_id == DEINT_ID_VBRS)
         av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
     else {
-        av_new_packet(pkt, st->codec->block_align);
+        int ret = av_new_packet(pkt, st->codec->block_align);
+        if (ret < 0)
+            return ret;
         memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
                (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
                st->codec->block_align);



More information about the ffmpeg-cvslog mailing list