From 8c9553769847bf69561fa5c421cb92afdca84380 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 5 Nov 2016 07:14:46 +0100 Subject: [PATCH] sio_oss.c: Disallow tiny fragment sizes, as they may overload the system. And as sndiod runs with increased priority, it would consume all the cpu and could in turn hang the system. --- libsndio/sio_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsndio/sio_oss.c b/libsndio/sio_oss.c index 22f4b47..4ba910c 100644 --- a/libsndio/sio_oss.c +++ b/libsndio/sio_oss.c @@ -459,7 +459,7 @@ sio_oss_setpar(struct sio_hdl *sh, struct sio_par *par) } frag_max = round * hdl->chan * formats[i].bps; - frag_shift = 0; + frag_shift = 8; while (1 << (frag_shift + 1) <= frag_max) frag_shift++;