diff options
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r-- | libavformat/rtpdec.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index d16122d40d..18cc16fcfe 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -2,20 +2,20 @@ * RTP input format * Copyright (c) 2002 Fabrice Bellard * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -556,7 +556,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: @@ -574,11 +575,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; } @@ -781,7 +784,7 @@ int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p, int value_size = strlen(p) + 1; if (!(value = av_malloc(value_size))) { - av_log(NULL, AV_LOG_ERROR, "Failed to allocate data for FMTP."); + av_log(NULL, AV_LOG_ERROR, "Failed to allocate data for FMTP.\n"); return AVERROR(ENOMEM); } |