1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-02-15 20:31:57 +01:00
parent 25893ad6c9
commit 60991ad6ae

View File

@ -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])
buf->data[i] = buf->base[i];
else
buf->data[i] = buf->base[i] +