alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ASoC: compress: fix unsigned integer overflow check
@ 2019-10-21  9:54 Srinivas Kandagatla
  2019-10-21 10:45 ` Vinod Koul
  2019-10-21 18:00 ` [alsa-devel] Applied "ASoC: compress: fix unsigned integer overflow check" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-10-21  9:54 UTC (permalink / raw)
  To: broonie, vkoul, tiwai
  Cc: Srinivas Kandagatla, alsa-devel, bgoswami, Xiaojun Sang, spapothi

From: Xiaojun Sang <xsang@codeaurora.org>

Parameter fragments and fragment_size are type of u32. U32_MAX is
the correct check.

Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/core/compress_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 41905afada63..f34ce564d92c 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -528,7 +528,7 @@ static int snd_compress_check_input(struct snd_compr_params *params)
 {
 	/* first let's check the buffer parameter's */
 	if (params->buffer.fragment_size == 0 ||
-	    params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
+	    params->buffer.fragments > U32_MAX / params->buffer.fragment_size ||
 	    params->buffer.fragments == 0)
 		return -EINVAL;
 
-- 
2.21.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-21 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21  9:54 [alsa-devel] [PATCH] ASoC: compress: fix unsigned integer overflow check Srinivas Kandagatla
2019-10-21 10:45 ` Vinod Koul
2019-10-21 18:00 ` [alsa-devel] Applied "ASoC: compress: fix unsigned integer overflow check" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).