aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dvdsubdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-04-07 03:36:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 12:20:15 +0200
commit0a6598536cbc4daf71f63a28a7b6dce08be1f122 (patch)
treeddbd421122cf8f001c7e5a0093933e431b280465 /libavcodec/dvdsubdec.c
parent7655f73c45a1c81569812764c48113a7fa726eca (diff)
downloadffmpeg-0a6598536cbc4daf71f63a28a7b6dce08be1f122.tar.gz
avcodec/dvdsubdec: Fixes 2 runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
Fixes: 619/clusterfuzz-testcase-5803914534322176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 61ee2ca7758672128e30b3e87908b6845e006d71) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index e91d63ea29..cea166e131 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -189,12 +189,12 @@ static void guess_palette(DVDSubContext* ctx,
r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
b = (((subtitle_color >> 0) & 0xff) * level) >> 8;
- rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17) << 24);
+ rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17U) << 24);
color_used[colormap[i]] = (i + 1);
j++;
} else {
rgba_palette[i] = (rgba_palette[color_used[colormap[i]] - 1] & 0x00ffffff) |
- ((alpha[i] * 17) << 24);
+ ((alpha[i] * 17U) << 24);
}
}
}