summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-19 11:01:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-19 11:01:26 +0200
commit20dfab33f5ab61fc51de65192ed239f8b62782a2 (patch)
treef5164b3f79ab48e4dd4c027bef968666f7748716 /libavformat/mov.c
parentf54d751f33375054d4ecf30301ef008c8e781f99 (diff)
parent5626f994f273af80fb100d4743b963304de9e05c (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/mov.c')
-rw-r--r--libavformat/mov.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index abeeaaed1f..4b7b4c3b6f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -981,6 +981,7 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,
AVStream *st;
uint64_t size;
uint8_t *buf;
+ int err;
if (c->fc->nb_streams < 1) // will happen with jp2 files
return 0;
@@ -992,11 +993,9 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,
size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;
if (size > INT_MAX || (uint64_t)atom.size > INT_MAX)
return AVERROR_INVALIDDATA;
- buf= av_realloc(st->codec->extradata, size);
- if (!buf)
- return AVERROR(ENOMEM);
- st->codec->extradata= buf;
- buf+= st->codec->extradata_size;
+ if ((err = av_reallocp(&st->codec->extradata, size)) < 0)
+ return err;
+ buf = st->codec->extradata + st->codec->extradata_size;
st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;
AV_WB32( buf , atom.size + 8);
AV_WL32( buf + 4, atom.type);