Skip to content
Snippets Groups Projects
Commit c92f5584 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/dvdsubdec: Fix off by 1 error


Fixes out of array read

Found-by: Thomas Garnier using libFuzzer
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent e936c8d1
No related branches found
No related tags found
No related merge requests found
...@@ -185,7 +185,7 @@ static void guess_palette(DVDSubContext* ctx, ...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment