diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 0fb3a17fc3..14701e22f4 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -78,7 +78,7 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s) void ff_mjpeg_encode_close(MpegEncContext *s) { - av_free(s->mjpeg_ctx); + av_freep(&s->mjpeg_ctx); } static void encode_block(MpegEncContext *s, int16_t *block, int n)