1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2026-05-16 08:38:24 +02:00

avcodec/dvdsubdec: Fix off by 1 error

Fixes out of array read

Found-by: Thomas Garnier using libFuzzer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c92f55847a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2016-10-26 00:11:52 +02:00
parent 3177ea512f
commit fe4c6aeb99
+1 -1
View File
@@ -185,7 +185,7 @@ static void guess_palette(DVDSubContext* ctx,
for(i = 0; i < 4; i++) { for(i = 0; i < 4; i++) {
if (alpha[i] != 0) { if (alpha[i] != 0) {
if (!color_used[colormap[i]]) { if (!color_used[colormap[i]]) {
level = level_map[nb_opaque_colors][j]; level = level_map[nb_opaque_colors - 1][j];
r = (((subtitle_color >> 16) & 0xff) * level) >> 8; r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
g = (((subtitle_color >> 8) & 0xff) * level) >> 8; g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
b = (((subtitle_color >> 0) & 0xff) * level) >> 8; b = (((subtitle_color >> 0) & 0xff) * level) >> 8;