diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 13:01:26 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 13:01:26 +0400 |
commit | 20dfab33f5ab61fc51de65192ed239f8b62782a2 (patch) | |
tree | f5164b3f79ab48e4dd4c027bef968666f7748716 /libavformat/mmst.c | |
parent | f54d751f33375054d4ecf30301ef008c8e781f99 (diff) | |
parent | 5626f994f273af80fb100d4743b963304de9e05c (diff) |
Merge commit '5626f994f273af80fb100d4743b963304de9e05c'
* commit '5626f994f273af80fb100d4743b963304de9e05c':
avformat: Use av_reallocp() where suitable
Conflicts:
libavformat/avidec.c
libavformat/avienc.c
libavformat/aviobuf.c
libavformat/oggparsevorbis.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 c3d2ebb8b9..dbfe31dc95 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; |