From 5541af78b1b3ec506fcdd03c96104c4b10168742 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 1 Oct 2010 20:44:58 +0000 Subject: GRAPHICS: Add BPP check to Surface::move. svn-id: r52968 --- graphics/surface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphics/surface.cpp b/graphics/surface.cpp index b704c7fc9c..f06c24c2cd 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -185,6 +185,9 @@ void Surface::move(int dx, int dy, int height) { if ((dx == 0 && dy == 0) || height <= 0) return; + if (bytesPerPixel != 1 && bytesPerPixel != 2) + error("Surface::move: bytesPerPixel must be 1 or 2"); + byte *src, *dst; int x, y; -- cgit v1.2.3