Commit 67ddf216 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/vdpau: do not dereference hwctx before checking it for NULL

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4d8356b6
...@@ -89,7 +89,6 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, ...@@ -89,7 +89,6 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
vdctx->width = UINT32_MAX; vdctx->width = UINT32_MAX;
vdctx->height = UINT32_MAX; vdctx->height = UINT32_MAX;
hwctx->reset = 0;
if (!hwctx) { if (!hwctx) {
vdctx->device = VDP_INVALID_HANDLE; vdctx->device = VDP_INVALID_HANDLE;
...@@ -103,6 +102,7 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, ...@@ -103,6 +102,7 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
vdctx->device = VDP_INVALID_HANDLE; vdctx->device = VDP_INVALID_HANDLE;
return 0; /* Decoder created by user */ return 0; /* Decoder created by user */
} }
hwctx->reset = 0;
vdctx->device = hwctx->device; vdctx->device = hwctx->device;
vdctx->get_proc_address = hwctx->get_proc_address; vdctx->get_proc_address = hwctx->get_proc_address;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment