Skip to content

Commit c92f558

Browse files
committed
avcodec/dvdsubdec: Fix off by 1 error
Fixes out of array read Found-by: Thomas Garnier using libFuzzer Signed-off-by: Michael Niedermayer <[email protected]>
1 parent e936c8d commit c92f558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavcodec/dvdsubdec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static void guess_palette(DVDSubContext* ctx,
185185
for(i = 0; i < 4; i++) {
186186
if (alpha[i] != 0) {
187187
if (!color_used[colormap[i]]) {
188-
level = level_map[nb_opaque_colors][j];
188+
level = level_map[nb_opaque_colors - 1][j];
189189
r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
190190
g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
191191
b = (((subtitle_color >> 0) & 0xff) * level) >> 8;

0 commit comments

Comments
 (0)