Fix division by zero
Consider a zero we need to divide with illegal input. Fixes oss-fuzz 29347 Change-Id: I2aae1d765d2dd81c95d423038ef5cb878d4f8026 Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit 16b8d766abe86868597b30cec03152355ee1a91b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
86af184205
commit
fada6a1cbd
@ -524,6 +524,8 @@ bool parseTRC(const QByteArray &data, const TagEntry &tagEntry, QColorTrc &gamma
|
||||
return false;
|
||||
std::array<quint32_be, 3> parameters =
|
||||
qFromUnaligned<decltype(parameters)>(data.constData() + parametersOffset);
|
||||
if (parameters[1] == 0)
|
||||
return false;
|
||||
float g = fromFixedS1516(parameters[0]);
|
||||
float a = fromFixedS1516(parameters[1]);
|
||||
float b = fromFixedS1516(parameters[2]);
|
||||
@ -537,6 +539,8 @@ bool parseTRC(const QByteArray &data, const TagEntry &tagEntry, QColorTrc &gamma
|
||||
return false;
|
||||
std::array<quint32_be, 4> parameters =
|
||||
qFromUnaligned<decltype(parameters)>(data.constData() + parametersOffset);
|
||||
if (parameters[1] == 0)
|
||||
return false;
|
||||
float g = fromFixedS1516(parameters[0]);
|
||||
float a = fromFixedS1516(parameters[1]);
|
||||
float b = fromFixedS1516(parameters[2]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user