summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-01-20 18:31:57 +0200
committerMartin Storsjö <martin@martin.st>2013-01-21 00:08:19 +0200
commita76bc3bc44e3bcd6a0923e65cd669e71e9819388 (patch)
treeb48d3ba68976ff178d675f3ae8f1579db5550bda /libavformat/rtpdec.c
parent04ea5491a83e7d123faae5f9aff054838d95bbcb (diff)
rtpdec: Check the return value from av_new_packet
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 4379e6f4f1..a8188878eb 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -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 {