From 07834616b3741dfbf6b345a7610244faa105382d Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 3 Mar 2019 12:23:04 +0000 Subject: GRAPHICS: Fix dstFormat check in Surface::convertTo --- graphics/surface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/surface.cpp') diff --git a/graphics/surface.cpp b/graphics/surface.cpp index de921a7269..265249e72f 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -434,7 +434,7 @@ Graphics::Surface *Surface::convertTo(const PixelFormat &dstFormat, const byte * if (format.bytesPerPixel == 0 || format.bytesPerPixel > 4) error("Surface::convertTo(): Can only convert from 1Bpp, 2Bpp, 3Bpp, and 4Bpp"); - if (dstFormat.bytesPerPixel < 2 && dstFormat.bytesPerPixel > 4) + if (dstFormat.bytesPerPixel < 2 || dstFormat.bytesPerPixel > 4) error("Surface::convertTo(): Can only convert to 2Bpp, 3Bpp and 4Bpp"); surface->create(w, h, dstFormat); -- cgit v1.2.3