mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
pulse-server: make sure we don't exceed maxlength
Make sure the various buffer attributes don't exceed maxlength. Add some SPA_ROUND_UP and SPA_ROUND_DOWN macros. Fixes #2100
This commit is contained in:
parent
877dc77645
commit
8c10080324
2 changed files with 15 additions and 13 deletions
|
|
@ -228,6 +228,9 @@ struct spa_fraction {
|
|||
#define SPA_RESTRICT
|
||||
#endif
|
||||
|
||||
#define SPA_ROUND_DOWN(num,value) ((num) - ((num) % (value)))
|
||||
#define SPA_ROUND_UP(num,value) ((((num) + (value) - 1) / (value)) * (value))
|
||||
|
||||
#define SPA_ROUND_DOWN_N(num,align) ((num) & ~((align) - 1))
|
||||
#define SPA_ROUND_UP_N(num,align) SPA_ROUND_DOWN_N((num) + ((align) - 1),align)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue