[FFmpeg-cvslog] ffmpeg: Fix image allocation.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Feb 15 22:32:40 CET 2012


On 15 Feb 2012, at 21:39, git at videolan.org (Michael Niedermayer) wrote:
> ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 15 20:31:57 2012 +0100| [60991ad6ae61e131085891c37e8e517b5014ce21] | committer: Michael Niedermayer
> 
> ffmpeg: Fix image allocation.
> 
> This probably fixes some of the use of uninitialized issues valgrind shows in fate.
> It might also fix other issues.
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> 
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60991ad6ae61e131085891c37e8e517b5014ce21
> ---
> 
> ffmpeg.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index efe579a..8659ff7 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -510,7 +510,7 @@ static int alloc_buffer(AVCodecContext *s, InputStream *ist, FrameBuffer **pbuf)
>     for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
>         const int h_shift = i==0 ? 0 : h_chroma_shift;
>         const int v_shift = i==0 ? 0 : v_chroma_shift;
> -        if (s->flags & CODEC_FLAG_EMU_EDGE)
> +        if ((s->flags & CODEC_FLAG_EMU_EDGE) || !buf->linesize[1])

Could you explain the logic behind using [1] and not [i]?
As a hack to detect paletted formats it seems not that great/reliable.


More information about the ffmpeg-cvslog mailing list