Skip to content

Commit

Permalink
corrects pointer arithmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadym committed Jul 20, 2023
1 parent c128f96 commit 535dfaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/indigo-core/molecule/molecule_cdxml_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ namespace indigo
ptr += sizeof(uint16_t) + *pstyles * sizeof(CDXTextStyle);
auto ptext_style = (CDXTextStyle*)(pstyles + 1);
ptr += ptext_style[_style_index].offset;
if ((ptr - _data) < _size)
if ((ptr - (char*)_data) < _size)
{
if ((_style_index + 1) < *pstyles)
return std::string(ptr, ptext_style[_style_index + 1].offset - ptext_style[_style_index].offset);
Expand Down

0 comments on commit 535dfaf

Please sign in to comment.