mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-06 06:05:32 +01:00
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
committed by
Diego Biurrun
parent
0f310a6f33
commit
5626f994f2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user