aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.cpp
diff options
context:
space:
mode:
authorCameron Cawley2019-03-03 12:23:04 +0000
committerBastien Bouclet2019-03-03 13:44:53 +0100
commit07834616b3741dfbf6b345a7610244faa105382d (patch)
treed8b1447641eecf586868b4f295af59de89d60d15 /graphics/surface.cpp
parent342733cee6c9dc3db94ff88cb2278a501150bc1c (diff)
downloadscummvm-rg350-07834616b3741dfbf6b345a7610244faa105382d.tar.gz
scummvm-rg350-07834616b3741dfbf6b345a7610244faa105382d.tar.bz2
scummvm-rg350-07834616b3741dfbf6b345a7610244faa105382d.zip
GRAPHICS: Fix dstFormat check in Surface::convertTo
Diffstat (limited to 'graphics/surface.cpp')
-rw-r--r--graphics/surface.cpp2
1 files changed, 1 insertions, 1 deletions
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);