[CPAL] Fix version checking logic on sanitizer (#851)
This commit is contained in:
parent
bcf578fefe
commit
7e958646a4
|
@ -89,7 +89,6 @@ struct CPALV1Tail
|
||||||
LOffsetTo<HBUINT32> paletteFlags;
|
LOffsetTo<HBUINT32> paletteFlags;
|
||||||
LOffsetTo<HBUINT16> paletteLabel;
|
LOffsetTo<HBUINT16> paletteLabel;
|
||||||
LOffsetTo<HBUINT16> paletteEntryLabel;
|
LOffsetTo<HBUINT16> paletteEntryLabel;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (12);
|
DEFINE_SIZE_STATIC (12);
|
||||||
};
|
};
|
||||||
|
@ -113,14 +112,13 @@ struct CPAL
|
||||||
if (colorRecordIndices[i] + numPaletteEntries > colorRecords.get_size ())
|
if (colorRecordIndices[i] + numPaletteEntries > colorRecords.get_size ())
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
if (version > 1)
|
// If version is zero, we are done here; otherwise we need to check tail also
|
||||||
{
|
if (version == 0)
|
||||||
|
return_trace (true);
|
||||||
|
|
||||||
const CPALV1Tail &v1 = StructAfter<CPALV1Tail> (*this);
|
const CPALV1Tail &v1 = StructAfter<CPALV1Tail> (*this);
|
||||||
return_trace (v1.sanitize (c, palettes));
|
return_trace (v1.sanitize (c, palettes));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return_trace (true);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline unsigned int get_size (void) const
|
inline unsigned int get_size (void) const
|
||||||
{
|
{
|
||||||
|
@ -158,7 +156,7 @@ struct CPAL
|
||||||
HBUINT16 numPalettes;
|
HBUINT16 numPalettes;
|
||||||
ArrayOf<ColorRecord> colorRecords;
|
ArrayOf<ColorRecord> colorRecords;
|
||||||
HBUINT16 colorRecordIndices[VAR]; // VAR=numPalettes
|
HBUINT16 colorRecordIndices[VAR]; // VAR=numPalettes
|
||||||
|
/*CPALV1Tail v1[VAR];*/
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_ARRAY (12, colorRecordIndices);
|
DEFINE_SIZE_ARRAY (12, colorRecordIndices);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue