mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/shorten: use av_reallocp_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
56c7e1059a
commit
fbe8672e15
@ -136,12 +136,12 @@ static int allocate_buffers(ShortenContext *s)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((err = av_reallocp(&s->offset[chan],
|
if ((err = av_reallocp_array(&s->offset[chan],
|
||||||
sizeof(int32_t) *
|
sizeof(int32_t),
|
||||||
FFMAX(1, s->nmean))) < 0)
|
FFMAX(1, s->nmean))) < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if ((err = av_reallocp(&s->decoded_base[chan], (s->blocksize + s->nwrap) *
|
if ((err = av_reallocp_array(&s->decoded_base[chan], (s->blocksize + s->nwrap),
|
||||||
sizeof(s->decoded_base[0][0]))) < 0)
|
sizeof(s->decoded_base[0][0]))) < 0)
|
||||||
return err;
|
return err;
|
||||||
for (i = 0; i < s->nwrap; i++)
|
for (i = 0; i < s->nwrap; i++)
|
||||||
@ -149,7 +149,7 @@ static int allocate_buffers(ShortenContext *s)
|
|||||||
s->decoded[chan] = s->decoded_base[chan] + s->nwrap;
|
s->decoded[chan] = s->decoded_base[chan] + s->nwrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((err = av_reallocp(&s->coeffs, s->nwrap * sizeof(*s->coeffs))) < 0)
|
if ((err = av_reallocp_array(&s->coeffs, s->nwrap, sizeof(*s->coeffs))) < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user