summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-02-20 16:41:22 +0000
committerCarl Hetherington <cth@carlh.net>2020-02-20 22:39:17 +0100
commit635f703a3ceba0d4fe8e13ef291d416cc806eb59 (patch)
tree7033704f5db4880584163bf80aa06b1aad81c8db
parent0adbc0c5ff395b75e7696341896f0e223d115df5 (diff)
Fix non-aligned subtitle access in the subtitle examiner as well.v2.14.28
-rw-r--r--src/lib/examine_ffmpeg_subtitles_job.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/examine_ffmpeg_subtitles_job.cc b/src/lib/examine_ffmpeg_subtitles_job.cc
index af548b794..b9d5f54e5 100644
--- a/src/lib/examine_ffmpeg_subtitles_job.cc
+++ b/src/lib/examine_ffmpeg_subtitles_job.cc
@@ -82,16 +82,17 @@ ExamineFFmpegSubtitlesJob::run ()
/* sub_p looks up into a BGRA palette which is here
(i.e. first byte B, second G, third R, fourth A)
*/
- uint32_t const * palette = (uint32_t *) rect->pict.data[1];
+ uint8_t const * palette = rect->pict.data[1];
#else
/* sub_p looks up into a BGRA palette which is here
(i.e. first byte B, second G, third R, fourth A)
*/
- uint32_t const * palette = (uint32_t *) rect->data[1];
+ uint8_t const * palette = rect->data[1];
#endif
for (int j = 0; j < rect->nb_colors; ++j) {
- RGBA c ((palette[j] & 0xff0000) >> 16, (palette[j] & 0xff00) >> 8, palette[j] & 0xff, (palette[j] & 0xff000000) >> 24);
+ RGBA c (palette[2], palette[1], palette[0], palette[3]);
_content->subtitle_stream()->set_colour (c, c);
+ palette += 4;
}
}
}