Przeglądaj źródła

Fixed potential buffer overflow in YUV conversion

Fixes https://github.com/libsdl-org/SDL/issues/5043
Sam Lantinga 4 lat temu
rodzic
commit
8589134f16
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/video/yuv2rgb/yuv_rgb.c

+ 1 - 1
src/video/yuv2rgb/yuv_rgb.c

@@ -91,7 +91,7 @@ static uint8_t clampU8(int32_t v)
 	255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
 	255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
 	};
-	return lut[(v+128*PRECISION_FACTOR)>>PRECISION];
+	return lut[((v+128*PRECISION_FACTOR)>>PRECISION)&511];
 }