[FFmpeg-devel] [PATCH 2/2] Use av_fast_malloc instead of av_realloc. This should be faster, is less code and fixes issue 2524 (allocation error would lead to crash). (cherry picked from commit e7b95918fca1c3d057d35f77ba58ee2d00d03151)

Luca Barbato lu_zero
Mon Jan 24 21:03:03 CET 2011


On 01/24/2011 08:59 PM, Janne Grunau wrote:
> -        c->decomp_size = c->height * c->width * 3 / 2;
> -        c->decomp_buf = av_realloc(c->decomp_buf, c->decomp_size + AV_LZO_OUTPUT_PADDING);
> +        av_fast_malloc(&c->decomp_buf, &c->decomp_size, c->height * c->width * 3 / 2);

when decomp_size is updated then?

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero




More information about the ffmpeg-devel mailing list