diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-20 23:00:08 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-10-21 06:19:21 +0000 |
commit | 294c870bedadc7823d61bc8df6fd37323589f0a2 (patch) | |
tree | 79f2851fd525ebcce4e2fa4535aae5d58e23e1c7 /tests/auto/network | |
parent | b6df7257501b54521c25587c3c5e600b2c9393d1 (diff) |
QImage: cache colortable size
Coverity threw an error that in the else branch, the expression
colorTableRGB16[tableSize - 1] accesses uninit'ed data. The working
theory is that it fails to perform the implication
isEmpty() → size() == 0
This patch, therefore, checks for size() == 0 instead of isEmpty(),
which is hardly less readable and might help Coverity understand the
code better.
Then again, Coverity might not understand that the tableSize can never
be negative. If that's the case, another patch will be needed, but
let's try the simpler solution first.
Coverity-Id: 11420
Change-Id: Ibfe2a798c55af95c8001fa909aa94a6c5bc7c647
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/network')
0 files changed, 0 insertions, 0 deletions