summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavcodec/decode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index f7dea93..dccce01 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1248,16 +1248,16 @@ static int setup_hwaccel(AVCodecContext *avctx,
return AVERROR(ENOMEM);
}
+ avctx->hwaccel = hwa;
if (hwa->init) {
ret = hwa->init(avctx);
if (ret < 0) {
av_freep(&avctx->internal->hwaccel_priv_data);
+ avctx->hwaccel = NULL;
return ret;
}
}
- avctx->hwaccel = hwa;
-
return 0;
}
OpenPOWER on IntegriCloud