Browse Source

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>
tags/n3.2
Michael Niedermayer 8 years ago
parent
commit
c92f55847a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/dvdsubdec.c

+ 1
- 1
libavcodec/dvdsubdec.c View File

@@ -185,7 +185,7 @@ static void guess_palette(DVDSubContext* ctx,
for(i = 0; i < 4; i++) {
if (alpha[i] != 0) {
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;
g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
b = (((subtitle_color >> 0) & 0xff) * level) >> 8;


Loading…
Cancel
Save