rtpdec: Check the return value from av_new_packet
authorMartin Storsjö <martin@martin.st>
Sun, 20 Jan 2013 16:31:57 +0000 (18:31 +0200)
committerMartin Storsjö <martin@martin.st>
Sun, 20 Jan 2013 22:08:19 +0000 (00:08 +0200)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtpdec.c

index 4379e6f..a818887 100644 (file)
@@ -635,7 +635,8 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
     } else if (st) {
         /* At this point, the RTP header has been stripped;
          * This is ASSUMING that there is only 1 CSRC, which isn't wise. */
-        av_new_packet(pkt, len);
+        if ((rv = av_new_packet(pkt, len)) < 0)
+            return rv;
         memcpy(pkt->data, buf, len);
         pkt->stream_index = st->index;
     } else {