Skip to content

CodeQl gives overflow warning for flowgraph/resampler #1506

@ann0see

Description

@ann0see

Short description
CodeQl flags the following lines as high severity issues (probably they are not severe at all, therefore posting it publically): "Multiplication result converted to larger type
High
Multiplication result may overflow 'int' before it is converted to 'size_type'."
See i.e:
https://github.com/github/codeql/blob/17fbbdba34d755fa318d588732f75708aa110be5/cpp/ql/src/Likely%20Bugs/Arithmetic/IntMultToLong.ql

mCoefficients.resize(getNumTaps() * numRows);

, mX(builder.getChannelCount() * builder.getNumTaps() * 2)

image
image
image
image

Steps to reproduce
Clone an app using oboe
Set up CodeQl
Compile and observe warnings from CodeQl as mentioned above
Expected behavior
No warnings of CodeQl. Should be fixed by smaller code-refactorings probably.
Actual behavior
The error log in CodeQl is warning about issues concerning overflow.
Device

/

Any additional context

/

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions