aviobuf: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 247a1dc847
)
This commit is contained in:

committed by
Michael Niedermayer

parent
7bc9c32573
commit
431937883f
@@ -921,7 +921,7 @@ int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size
|
||||
|
||||
alloc_size = FFMAX(s->buffer_size, new_size);
|
||||
if (alloc_size > buf_size)
|
||||
if (!(buf = av_realloc(buf, alloc_size)))
|
||||
if (!(buf = av_realloc_f(buf, 1, alloc_size)))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (new_size > buf_size) {
|
||||
@@ -1090,7 +1090,7 @@ static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
|
||||
}
|
||||
|
||||
if (new_allocated_size > d->allocated_size) {
|
||||
d->buffer = av_realloc(d->buffer, new_allocated_size);
|
||||
d->buffer = av_realloc_f(d->buffer, 1, new_allocated_size);
|
||||
if(d->buffer == NULL)
|
||||
return AVERROR(ENOMEM);
|
||||
d->allocated_size = new_allocated_size;
|
||||
|
Reference in New Issue
Block a user