OSDN Git Service

omx: hwaccel: fix memory leak
authorMichael Goffioul <michael.goffioul@gmail.com>
Fri, 27 Apr 2018 02:16:45 +0000 (10:16 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 27 Apr 2018 02:16:45 +0000 (10:16 +0800)
It's missing some cleanup when uninitializing the decoder.

omx/ffmpeg_hwaccel.c

index 229fcb1..33c84fb 100644 (file)
@@ -162,8 +162,10 @@ int ffmpeg_hwaccel_init(AVCodecContext *avctx)
 void ffmpeg_hwaccel_deinit(AVCodecContext *avctx)
 {
     if (avctx->opaque) {
-#ifdef LIBAV_CONFIG_H
         InputStream *ist = avctx->opaque;
+        if (ist->hwaccel_uninit)
+            ist->hwaccel_uninit(avctx);
+#ifdef LIBAV_CONFIG_H
         avcodec_free_context(&ist->dec_ctx);
 #endif
         av_freep(&avctx->opaque);