diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index f31c5e262b..c2f7ac9060 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -56,7 +56,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, unsigned type, const void *data, unsigned size, unsigned mb_count) { - void *dxva_data; + void *dxva_data = NULL; unsigned dxva_size; int result; HRESULT hr = 0; @@ -78,7 +78,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, type, hr); return -1; } - if (size <= dxva_size) { + if (dxva_data && size <= dxva_size) { memcpy(dxva_data, data, size); #if CONFIG_D3D11VA