diff options
author | Alexandra Khirnova <alexandra.khirnova@gmail.com> | 2013-09-18 18:12:36 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-09-18 18:28:38 +0200 |
commit | 5626f994f273af80fb100d4743b963304de9e05c (patch) | |
tree | 69a48a5383a83d06f8e25df3098cce219788e873 /libavformat/mmst.c | |
parent | 0f310a6f333b016d336674d086045e8473fdf918 (diff) | |
download | ffmpeg-5626f994f273af80fb100d4743b963304de9e05c.tar.gz |
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/mmst.c')
-rw-r--r-- | libavformat/mmst.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libavformat/mmst.c b/libavformat/mmst.c index 4b96f5d6af..41d01c4fc6 100644 --- a/libavformat/mmst.c +++ b/libavformat/mmst.c @@ -331,16 +331,14 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst) // if we successfully read everything. if(packet_id_type == mmst->header_packet_id) { + int err; packet_type = SC_PKT_ASF_HEADER; // Store the asf header if(!mms->header_parsed) { - void *p = av_realloc(mms->asf_header, - mms->asf_header_size + mms->remaining_in_len); - if (!p) { - av_freep(&mms->asf_header); - return AVERROR(ENOMEM); - } - mms->asf_header = p; + if ((err = av_reallocp(&mms->asf_header, + mms->asf_header_size + + mms->remaining_in_len)) < 0) + return err; memcpy(mms->asf_header + mms->asf_header_size, mms->read_in_ptr, mms->remaining_in_len); mms->asf_header_size += mms->remaining_in_len; |