aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-06-22 14:52:54 +0200
committerwm4 <nfxjfg@googlemail.com>2017-06-27 18:05:02 +0200
commit1509d739a036b9838e12f28dac9f09ac37bc3928 (patch)
tree925eedd409623c21d7fb61515f0fb15aa3b7c714 /libavutil
parent39f201a0ec7913f7509a01fb0fa6634a24e52203 (diff)
downloadffmpeg-1509d739a036b9838e12f28dac9f09ac37bc3928.tar.gz
hwcontext_d3d11va: fix crash on frames_init failure
It appears in this case, frames_ininit is called twice (once by av_hwframe_ctx_init(), and again by unreffing the frames ctx ref). Merges Libav commit 086321c612185469ebb85a1887527c8915b488b7. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/hwcontext_d3d11va.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index 5432dd8b51..0b36a563f1 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -104,9 +104,11 @@ static void d3d11va_frames_uninit(AVHWFramesContext *ctx)
if (frames_hwctx->texture)
ID3D11Texture2D_Release(frames_hwctx->texture);
+ frames_hwctx->texture = NULL;
if (s->staging_texture)
ID3D11Texture2D_Release(s->staging_texture);
+ s->staging_texture = NULL;
}
static void free_texture(void *opaque, uint8_t *data)