diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index d0a03e2a1f..7080ebf428 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -104,7 +104,7 @@ static int init(sh_video_t *sh){ /* AVRn stores huffman table in AVI header */ /* Pegasus MJPEG stores it also in AVI header, but it uses the common MJPG fourcc :( */ - if ((sh->bih->biSize != sizeof(BITMAPINFOHEADER)) && + if (sh->bih && (sh->bih->biSize != sizeof(BITMAPINFOHEADER)) && (sh->format == mmioFOURCC('A','V','R','n') || sh->format == mmioFOURCC('M','J','P','G'))) {