aboutsummaryrefslogtreecommitdiff
path: root/graphics/yuv_to_rgb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/yuv_to_rgb.cpp')
-rw-r--r--graphics/yuv_to_rgb.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/graphics/yuv_to_rgb.cpp b/graphics/yuv_to_rgb.cpp
index b1107a7475..831736cd75 100644
--- a/graphics/yuv_to_rgb.cpp
+++ b/graphics/yuv_to_rgb.cpp
@@ -203,6 +203,13 @@ namespace Graphics {
*((uint32 *)(d)) = (L[cr_r] | L[crb_g] | L[cb_b])
void convertYUV420ToRGB(Graphics::Surface *dst, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch) {
+ // Sanity checks
+ assert(dst && dst->pixels);
+ assert(dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4);
+ assert(ySrc && uSrc && vSrc);
+ assert((yWidth & 1) == 0);
+ assert((yHeight & 1) == 0);
+
const YUVToRGBLookup *lookup = YUVToRGBMan.getLookup(dst->format);
byte *dstPtr = (byte *)dst->pixels;