Skip to content

Commit

Permalink
Use unsigned short for keyIndex to avoid overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oobayly committed Sep 9, 2024
1 parent 0a4677d commit 86e3902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/attribute_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum class AttributePairType: uint8_t { String = 0, Float = 1, Bool = 2 };
// AttributePair is a key/value pair (with minzoom)
#pragma pack(push, 1)
struct AttributePair {
short keyIndex : 9;
unsigned short keyIndex : 9;
AttributePairType valueType : 2;
uint8_t minzoom : 5; // Support zooms from 0..31. In practice, we expect z16 to be the biggest minzoom.
union {
Expand Down

0 comments on commit 86e3902

Please sign in to comment.