ffmpeg: preserve NULL ptrs in get_buffer()

Fixes Ticket1260, Ticket1267

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-05-02 10:45:21 +02:00
parent 8501bed08c
commit b197c1c1ac
1 changed files with 1 additions and 1 deletions

View File

@ -569,7 +569,7 @@ static int alloc_buffer(InputStream *ist, AVCodecContext *s, 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) || !buf->linesize[1])
if ((s->flags & CODEC_FLAG_EMU_EDGE) || !buf->linesize[1] || !buf->base[i])
buf->data[i] = buf->base[i];
else
buf->data[i] = buf->base[i] +