mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
pic: Fix Invalid-enum-value undefined behaviour
Summary: Instead of directly casting the quint8 to PicChannelEncoding we just store the quint8 and compare it to the possible PicChannelEncoding values when needed oss-fuzz/19344 Reviewers: dfaure Reviewed By: dfaure Subscribers: dfaure, security-team, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25937
This commit is contained in:
parent
69effbf9f5
commit
f03739f222
@ -130,9 +130,7 @@ static QDataStream &operator>> (QDataStream &s, QList<PicChannel> &channels)
|
||||
PicChannel channel;
|
||||
s >> chained;
|
||||
s >> channel.size;
|
||||
quint8 encoding;
|
||||
s >> encoding;
|
||||
channel.encoding = PicChannelEncoding(encoding);
|
||||
s >> channel.encoding;
|
||||
s >> channel.code;
|
||||
channels << channel;
|
||||
++count;
|
||||
|
@ -119,7 +119,7 @@ struct PicHeader {
|
||||
*/
|
||||
struct PicChannel {
|
||||
quint8 size; /**< Bits per component per pixel. */
|
||||
PicChannelEncoding encoding; /**< How the channel's data is encoded. */
|
||||
quint8 encoding; /**< How the channel's data is encoded. */
|
||||
quint8 code; /**< Flag field to describe which components are encoded in
|
||||
this channel. */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user