frontends/va: Assert maximum number of temporal layers
There is a hardcoded limit of 4 layers in all structs, so make sure drivers will not return more. Reviewed-By: Sil Vilerino <sivileri@microsoft.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30151>
This commit is contained in:
@@ -281,6 +281,7 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
|
||||
value = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
|
||||
PIPE_VIDEO_ENTRYPOINT_ENCODE,
|
||||
PIPE_VIDEO_CAP_MAX_TEMPORAL_LAYERS);
|
||||
assert(value <= 4);
|
||||
if (value > 0) {
|
||||
value -= 1;
|
||||
value |= (1 << 8); /* temporal_layer_bitrate_control_flag */
|
||||
|
||||
Reference in New Issue
Block a user