summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--screen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 9b378f2..73e7ca5 100644
--- a/screen.c
+++ b/screen.c
@@ -58,7 +58,9 @@ int screen_open(int width, int height, int bpp)
screen_bpp = bpp;
screen_offset = 0; /* Can we get front buffer offset in vram? */
screen_pitch = screen_width*(screen_bpp/8);
- screen_pitch = (screen_pitch | 255)+1; /* Align on 256 bytes boundary */
+ if ((screen_pitch & 255)!=0) {
+ screen_pitch = (screen_pitch | 255)+1; /* Align on 256 bytes boundary */
+ }
printf("Screen: %dx%dx%d, pitch=%d, offset=0x%08x\n",
screen_width, screen_height, screen_bpp,