Skip to content
Browse files

DVD: Fix crash when displaying dvd menu button.

Backported from master 39e2fff

Refs #9677
  • Loading branch information...
1 parent 572b95a commit 30993d65c6fa7c9133c459f1fda4c99058e35ba7 Mark Kendall committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 mythtv/libs/libmythtv/subtitlescreen.cpp
View
12 mythtv/libs/libmythtv/subtitlescreen.cpp
@@ -525,9 +525,9 @@ void SubtitleScreen::DisplayDVDButton(AVSubtitle* dvdButton, QRect &buttonPos)
if (!blank)
{
- QVector<unsigned int> bg_palette;
- for (int i = 0; i < AVPALETTE_COUNT; i++)
- bg_palette.push_back(bgpalette[i]);
+ QVector<uint32_t> bg_palette(4);
+ for (int i = 0; i < 4; i++)
+ bg_palette[i] = bgpalette[i];
bg_image.setColorTable(bg_palette);
bg_image = bg_image.convertToFormat(QImage::Format_ARGB32);
AddScaledImage(bg_image, rect);
@@ -535,12 +535,12 @@ void SubtitleScreen::DisplayDVDButton(AVSubtitle* dvdButton, QRect &buttonPos)
}
QImage fg_image = bg_image.copy(buttonPos);
- QVector<unsigned int> fg_palette;
+ QVector<uint32_t> fg_palette(4);
uint32_t *fgpalette = (uint32_t *)(dvdButton->rects[1]->pict.data[1]);
if (fgpalette)
{
- for (int i = 0; i < AVPALETTE_COUNT; i++)
- fg_palette.push_back(fgpalette[i]);
+ for (int i = 0; i < 4; i++)
+ fg_palette[i] = fgpalette[i];
fg_image.setColorTable(fg_palette);
}

0 comments on commit 30993d6

Please sign in to comment.
Something went wrong with that request. Please try again.