From b197c1c1acac18cb9c9a54a9bd0bb13a8539bc3c Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Wed, 2 May 2012 10:45:21 +0200
Subject: [PATCH] ffmpeg: preserve NULL ptrs in get_buffer()

Fixes Ticket1260, Ticket1267

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index a13dcf73f61..f395a445003 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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] +
-- 
GitLab