Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 1337345

Browse files
committed
Fix packed headers attribute test in vaCreateConfig()
If packed headers are not supported then the only valid value for this attribute is VA_ATTRIB_NOT_SUPPORTED. If packed headers are supported, then the provided value must be some (possibly empty) subset of the supported headers. This fixes config creation with an empty packed header set, which the user may pass if they don't want to provide any packed headers. This pattern is used in at least libavcodec, where VP9 encoding is broken prior to this change. Fixes #362. Signed-off-by: Mark Thompson <[email protected]>
1 parent bb92421 commit 1337345

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/i965_drv_video.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,8 +1431,13 @@ i965_CreateConfig(VADriverContextP ctx,
14311431
if (attrib_found) {
14321432
uint32_t enc_packed_attribs = i965_get_enc_packed_attributes(ctx, profile, entrypoint);
14331433

1434-
if (!(attrib_found->value & enc_packed_attribs))
1435-
vaStatus = VA_STATUS_ERROR_INVALID_VALUE;
1434+
if (enc_packed_attribs == VA_ATTRIB_NOT_SUPPORTED) {
1435+
if (attrib_found->value != VA_ATTRIB_NOT_SUPPORTED)
1436+
vaStatus = VA_STATUS_ERROR_INVALID_VALUE;
1437+
} else {
1438+
if (attrib_found->value & ~enc_packed_attribs)
1439+
vaStatus = VA_STATUS_ERROR_INVALID_VALUE;
1440+
}
14361441
}
14371442
}
14381443

0 commit comments

Comments
 (0)