diff --git a/ffmpeg.c b/ffmpeg.c index a13dcf73f6..f395a44500 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] +