rmdec: check av_new_packet return value
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 20 Oct 2014 13:11:17 +0000 (14:11 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 21 Oct 2014 13:37:48 +0000 (14:37 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 733714

libavformat/rmdec.c

index 79a0756..40cc357 100644 (file)
@@ -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 {
         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);
         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);