[FFmpeg-devel] [PATCH] avcodec/vaapi:free slice_buffers when decoding failed
Linjie Fu
linjie.fu at intel.com
Fri Sep 14 10:25:34 EEST 2018
If vaEndPicture failed in ff_vaapi_decode_issue, free
the pic->slice_buffer.
Fix the memory leak issue in ticket #7385
Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
libavcodec/vaapi_decode.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index d0a6b5817d..700cd5c681 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -216,6 +216,11 @@ fail_with_picture:
fail:
ff_vaapi_decode_destroy_buffers(avctx, pic);
fail_at_end:
+ pic->nb_param_buffers = 0;
+ pic->nb_slices = 0;
+ pic->slices_allocated = 0;
+ av_freep(&pic->slice_buffers);
+
return err;
}
--
2.17.1
More information about the ffmpeg-devel
mailing list