Fixed possible NULL pointer dereference in video/dec0.c [Oliver Stoneberg]

---------- Forwarded message ----------
From: Oliver Stöneberg <oliverst@online.de>
Date: Mon, Nov 16, 2009 at 7:59 PM
Subject: possible NULL pointer dereference
To: submit@mamedev.org


This pacth fixes a possible NULL pointer dereference in
src/mame/video/dec0.c reported by cppcheck.
This commit is contained in:
Phil Bennett 2009-11-19 23:18:09 +00:00
parent 205846afd7
commit aa2e1eb445

View File

@ -229,14 +229,17 @@ static void custom_tilemap_draw(running_machine *machine,
int column_offset=0, src_x=0, src_y=0;
UINT32 scrollx=control1[0];
UINT32 scrolly=control1[1];
int width_mask = src_bitmap->width - 1;
int height_mask = src_bitmap->height - 1;
int width_mask;
int height_mask;
int row_scroll_enabled = (rowscroll_ptr && (control0[0]&0x4));
int col_scroll_enabled = (colscroll_ptr && (control0[0]&0x8));
if (!src_bitmap)
return;
width_mask = src_bitmap->width - 1;
height_mask = src_bitmap->height - 1;
/* Column scroll & row scroll may per applied per pixel, there are
shift registers for each which control the granularity of the row/col
offset (down to per line level for row, and per 8 lines for column).