mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
audiotestsrc: convert sizes
to const size_t
`sizes` members participate in multiplication and subsequent assignment into port->bpf, which has size_t. So LGTM rightfully complains, there's a chance the multiplication will overflow before the assignment happens. Should have no influence on performance since 64 bit multiplication is as fast, and since the struct is constified, a wise compiler should make sure it doesn't take excess space either. Fixes LGTM warning: Multiplication result may overflow 'unsigned int' before it is converted to 'size_t'.
This commit is contained in:
parent
ab71d2c3cb
commit
dea1a0bee2
|
@ -725,7 +725,7 @@ port_set_format(struct impl *this,
|
||||||
} else {
|
} else {
|
||||||
struct spa_audio_info info = { 0 };
|
struct spa_audio_info info = { 0 };
|
||||||
int idx;
|
int idx;
|
||||||
int sizes[4] = { 2, 4, 4, 8 };
|
const size_t sizes[4] = { 2, 4, 4, 8 };
|
||||||
|
|
||||||
if ((res = spa_format_parse(format, &info.media_type, &info.media_subtype)) < 0)
|
if ((res = spa_format_parse(format, &info.media_type, &info.media_subtype)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue