From 8b926ff08445694da4df397da32b814b363fcf4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BD=B3=E5=92=8C?= Date: Tue, 16 Jun 2026 10:44:17 +0800 Subject: [PATCH] compress-offload: fix fragment count validation in set_params Fix incorrect assertion condition that compares fragment_size with max_fragments instead of num_fragments. The condition should validate num_fragments range, not mix fragment_size with max_fragments limit. --- spa/plugins/alsa/compress-offload-api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/alsa/compress-offload-api.c b/spa/plugins/alsa/compress-offload-api.c index 38ad1870a..ed32cbfc0 100644 --- a/spa/plugins/alsa/compress-offload-api.c +++ b/spa/plugins/alsa/compress-offload-api.c @@ -93,7 +93,7 @@ int compress_offload_api_set_params(struct compress_offload_api_context *context ); assert( (num_fragments == 0) || - ((num_fragments >= context->caps.min_fragments) && (fragment_size <= context->caps.max_fragments)) + ((num_fragments >= context->caps.min_fragments) && (num_fragments <= context->caps.max_fragments)) ); context->fragment_size = (fragment_size != 0) ? fragment_size : context->caps.min_fragment_size;