diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-16 12:13:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-16 12:13:16 +0100 |
commit | 1459f34251c35e5ba5af38ab9ae25ec134dbc845 (patch) | |
tree | 5f5d7b8d1efb472240a405e829db278fecfde179 /libavformat/rtpdec_mpeg4.c | |
parent | 9ea65c65f70029896b1c23afd9925ae42c4d009f (diff) | |
parent | 977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa (diff) | |
download | ffmpeg-1459f34251c35e5ba5af38ab9ae25ec134dbc845.tar.gz |
Merge commit '977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa'
* commit '977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa':
rtpdec_mpeg4: Check the return value from malloc
srtp: Mark a few variables as uninitialized
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpdec_mpeg4.c')
-rw-r--r-- | libavformat/rtpdec_mpeg4.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c index a3f60d348d..737d993b07 100644 --- a/libavformat/rtpdec_mpeg4.c +++ b/libavformat/rtpdec_mpeg4.c @@ -137,6 +137,8 @@ static int rtp_parse_mp4_au(PayloadContext *data, const uint8_t *buf) if (!data->au_headers || data->au_headers_allocated < data->nb_au_headers) { av_free(data->au_headers); data->au_headers = av_malloc(sizeof(struct AUHeaders) * data->nb_au_headers); + if (!data->au_headers) + return AVERROR(ENOMEM); data->au_headers_allocated = data->nb_au_headers; } @@ -162,6 +164,7 @@ static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data, const uint8_t *buf, int len, uint16_t seq, int flags) { + int ret; if (rtp_parse_mp4_au(data, buf)) return -1; @@ -170,7 +173,8 @@ static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data, /* XXX: Fixme we only handle the case where rtp_parse_mp4_au define one au_header */ - av_new_packet(pkt, data->au_headers[0].size); + if ((ret = av_new_packet(pkt, data->au_headers[0].size)) < 0) + return ret; memcpy(pkt->data, buf, data->au_headers[0].size); pkt->stream_index = st->index; |