summaryrefslogtreecommitdiff
path: root/sound/core/oss/pcm_plugin.c
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2022-05-19 18:11:52 +0200
committerPhilippe Schenker <philippe.schenker@toradex.com>2022-05-19 18:11:52 +0200
commit01a93acde83b4ee476a759e7de0df89b46130b0e (patch)
tree46218df72c9a2bef78fac3a2c469802b99f1dd0d /sound/core/oss/pcm_plugin.c
parent5c1ff16e904d73f3779d18e4674f82d758c3fff1 (diff)
parent01565c91b789a1612051e735a65f11096a6f08e8 (diff)
Merge tag 'v5.4.193' into toradex_5.4.y
This is the 5.4.193 stable release
Diffstat (limited to 'sound/core/oss/pcm_plugin.c')
-rw-r--r--sound/core/oss/pcm_plugin.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index da400da1fafe..8b7bbabeea24 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -61,7 +61,10 @@ static int snd_pcm_plugin_alloc(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t
}
if ((width = snd_pcm_format_physical_width(format->format)) < 0)
return width;
- size = frames * format->channels * width;
+ size = array3_size(frames, format->channels, width);
+ /* check for too large period size once again */
+ if (size > 1024 * 1024)
+ return -ENOMEM;
if (snd_BUG_ON(size % 8))
return -ENXIO;
size /= 8;