diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 11:01:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 11:01:26 +0200 |
commit | 20dfab33f5ab61fc51de65192ed239f8b62782a2 (patch) | |
tree | f5164b3f79ab48e4dd4c027bef968666f7748716 /libavformat/utils.c | |
parent | f54d751f33375054d4ecf30301ef008c8e781f99 (diff) | |
parent | 5626f994f273af80fb100d4743b963304de9e05c (diff) | |
download | ffmpeg-20dfab33f5ab61fc51de65192ed239f8b62782a2.tar.gz |
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/utils.c')
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 20770da2b8..aefee354e9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -355,12 +355,8 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, score = probe_size < max_probe_size ? AVPROBE_SCORE_RETRY : 0; /* read probe data */ - buftmp = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE); - if(!buftmp){ - av_free(buf); - return AVERROR(ENOMEM); - } - buf=buftmp; + if ((ret = av_reallocp(&buf, probe_size + AVPROBE_PADDING_SIZE)) < 0) + return ret; if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) { /* fail if error was not end of file, otherwise, lower score */ if (ret != AVERROR_EOF) { |