diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-21 01:07:16 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-21 01:07:16 +0400 |
commit | c4503a2e4010d2f0832a758aa6c8079fcf4bfac7 (patch) | |
tree | a0d29de5b9c404b88853d1295309c767f27d2d06 /libavformat | |
parent | 3a8b66af6cf6af9da5ff97a5930d10a7a4568558 (diff) |
rtpdec: check av_new_packet() return value
Fixes CID733715
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtpdec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index a90f0051c0..c62c2a932a 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -560,7 +560,8 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt, h = AV_RB32(buf); len -= 4; buf += 4; - av_new_packet(pkt, len); + if (av_new_packet(pkt, len) < 0) + return AVERROR(ENOMEM); memcpy(pkt->data, buf, len); break; case AV_CODEC_ID_MPEG1VIDEO: @@ -578,11 +579,13 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt, buf += 4; len -= 4; } - av_new_packet(pkt, len); + if (av_new_packet(pkt, len) < 0) + return AVERROR(ENOMEM); memcpy(pkt->data, buf, len); break; default: - av_new_packet(pkt, len); + if (av_new_packet(pkt, len) < 0) + return AVERROR(ENOMEM); memcpy(pkt->data, buf, len); break; } |