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/bmv.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/bmv.c')
-rw-r--r-- | libavformat/bmv.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/bmv.c b/libavformat/bmv.c index 09a5acbe67..8520a4d4fb 100644 --- a/libavformat/bmv.c +++ b/libavformat/bmv.c @@ -71,7 +71,7 @@ static int bmv_read_header(AVFormatContext *s) static int bmv_read_packet(AVFormatContext *s, AVPacket *pkt) { BMVContext *c = s->priv_data; - int type; + int type, err; void *tmp; while (c->get_next) { @@ -85,10 +85,8 @@ static int bmv_read_packet(AVFormatContext *s, AVPacket *pkt) c->size = avio_rl24(s->pb); if (!c->size) return AVERROR_INVALIDDATA; - tmp = av_realloc(c->packet, c->size + 1); - if (!tmp) - return AVERROR(ENOMEM); - c->packet = tmp; + if ((err = av_reallocp(&c->packet, c->size + 1)) < 0) + return err; c->packet[0] = type; if (avio_read(s->pb, c->packet + 1, c->size) != c->size) return AVERROR(EIO); |