summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/vaapi_encode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 45f5e57490..c3f4e44452 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1114,8 +1114,11 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx,
break;
}
}
- if (recon_format == AV_PIX_FMT_NONE)
- recon_format = constraints->valid_sw_formats[i];
+ if (recon_format == AV_PIX_FMT_NONE) {
+ // No match. Just use the first in the supported list and
+ // hope for the best.
+ recon_format = constraints->valid_sw_formats[0];
+ }
} else {
// No idea what to use; copy input format.
recon_format = ctx->input_frames->sw_format;