Re: [FFmpeg-devel] [PATCH] avcodec/dvdsubdec: Fix off by 1 error

2016-10-26 Thread Michael Niedermayer
On Wed, Oct 26, 2016 at 12:31:06AM +0200, Michael Niedermayer wrote:
> Fixes out of array read
> 
> Found-by: Thomas Garnier using libFuzzer
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/dvdsubdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/dvdsubdec: Fix off by 1 error

2016-10-25 Thread Michael Niedermayer
Fixes out of array read

Found-by: Thomas Garnier using libFuzzer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/dvdsubdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index b81b481..18475ec 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -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;
-- 
2.10.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel