[FFmpeg-devel] [PATCH] Decrease stack usage in svq1_encode_plane()

Måns Rullgård mans
Fri Jan 8 10:55:29 CET 2010


Zuxy Meng <zuxy.meng at gmail.com> writes:

> Hi,
>
> The stack usage can be substantially high if stride is large, which
> causes "make test" under Windows to fail due to stack overflow.
>
> -- 
> Zuxy
> Beauty is truth,
> While truth is beauty.
> PGP KeyID: E8555ED6
>
> Index: libavcodec/svq1enc.c
> ===================================================================
> --- libavcodec/svq1enc.c	(???? 21032)
> +++ libavcodec/svq1enc.c	(????????)
> @@ -275,6 +275,7 @@
>      int block_width, block_height;
>      int level;
>      int threshold[6];
> +    uint8_t *src = av_mallocz(stride*16*sizeof(uint8_t));

av_malloc() should be enough, no need to zero the memory.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list