diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index ec7effbec6b928193c33d1090c44bc0be3c400eb..a760988b810e963a4f2b4bd6378a31a6115f23b9 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -237,7 +237,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
-    if (!hwctx->render) {
+    if (!hwctx->render && hwctx->render2) {
         status = hwctx->render2(avctx, frame, (void *)&pic_ctx->info,
                                 pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
     } else