summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmpcodecs/vd_ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 6716995b20..5cd3a9a6ef 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -644,7 +644,7 @@ static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic){
}
// Palette support: free palette buffer allocated in get_buffer
- if ((mpi->bpp == 8) && (mpi->planes[1] != NULL))
+ if ( mpi && (mpi->bpp == 8) && (mpi->planes[1] != NULL))
free(mpi->planes[1]);
#if LIBAVCODEC_BUILD >= 4644