Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xbmc][fix] Don't try to index outside our lookup table and crash #10831

Merged
merged 1 commit into from
Nov 1, 2016

Conversation

Paxxi
Copy link
Member

@Paxxi Paxxi commented Oct 31, 2016

The lookup table was miscalculated and one chunk too small causing us to index outside of it and return garbage when using the style font_light + font_bold + font_italic = 7

Description

Increase the lookup table to be 256*8 instead of 256*7 and add a guard against this happening again by actually checking our index against our table size

Motivation and Context

How Has This Been Tested?

Locally

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@Paxxi Paxxi added Type: Fix non-breaking change which fixes an issue v17 Krypton Component: GUI engine labels Oct 31, 2016
@Paxxi Paxxi added this to the Krypton 17.0-beta6 milestone Oct 31, 2016
@phil65
Copy link
Contributor

phil65 commented Oct 31, 2016

Thx for lookin into it, @Paxxi !
@enen92 fyi.

@arnova
Copy link
Member

arnova commented Oct 31, 2016

Nice catch

@MartijnKaijser
Copy link
Member

jenkins build this please

@MilhouseVH
Copy link
Contributor

Build failure on Linux, looks like LOOKUPTABLE_SIZE will only be available on Windows (#ifdef HAS_DX):

In file included from GUIFont.cpp:22:0:
GUIFontTTF.h:162:26: error: ‘LOOKUPTABLE_SIZE’ was not declared in this scope
   Character *m_charquick[LOOKUPTABLE_SIZE];     // ascii chars (7 styles) here
                          ^
make[1]: *** [GUIFont.o] Error 1

@Paxxi
Copy link
Member Author

Paxxi commented Nov 1, 2016

@MilhouseVH yeah, I totally missed that ifdef, should be fixed now

@Paxxi
Copy link
Member Author

Paxxi commented Nov 1, 2016

jenkins build this please

@MartijnKaijser MartijnKaijser merged commit b37c556 into xbmc:master Nov 1, 2016
@enen92
Copy link
Member

enen92 commented Dec 5, 2016

Thanks for the fix @Paxxi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GUI engine Type: Fix non-breaking change which fixes an issue v17 Krypton
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants