$OpenBSD: patch-libmpcodecs_vd_ffmpeg_c,v 1.5 2016/04/04 12:54:32 espie Exp $
--- libmpcodecs/vd_ffmpeg.c.orig	Sat Apr  2 15:35:36 2016
+++ libmpcodecs/vd_ffmpeg.c	Sat Apr  2 15:36:27 2016
@@ -476,7 +476,8 @@ static int init(sh_video_t *sh){
             break;
         avctx->extradata_size = sh->bih->biSize-sizeof(*sh->bih);
         avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-        memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size);
+	if (avctx->extradata)
+		memcpy(avctx->extradata, sh->bih+1, avctx->extradata_size);
         break;
     }
 
