summaryrefslogtreecommitdiff
path: root/libavformat/bmv.c
diff options
context:
space:
mode:
authorAlexandra Khirnova <alexandra.khirnova@gmail.com>2013-09-18 18:12:36 +0200
committerDiego Biurrun <diego@biurrun.de>2013-09-18 18:28:38 +0200
commit5626f994f273af80fb100d4743b963304de9e05c (patch)
tree69a48a5383a83d06f8e25df3098cce219788e873 /libavformat/bmv.c
parent0f310a6f333b016d336674d086045e8473fdf918 (diff)
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/bmv.c')
-rw-r--r--libavformat/bmv.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/bmv.c b/libavformat/bmv.c
index ce157e842e..f474648970 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);