From 804789d73ee66857216f1e32c74c80dd65ef587f Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 6 Jan 2013 03:55:09 +0200 Subject: gpus: handle list underflows better --- plugins/gpu_unai/gpulib_if.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'plugins/gpu_unai') diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp index de16721..0d506bc 100644 --- a/plugins/gpu_unai/gpulib_if.cpp +++ b/plugins/gpu_unai/gpulib_if.cpp @@ -307,7 +307,11 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) gpuDrawLF(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]); num_vertexes++; - if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end) + if(list_position >= list_end) { + cmd = -1; + goto breakloop; + } + if((*list_position & 0xf000f000) == 0x50005000) break; } @@ -338,7 +342,11 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) gpuDrawLG(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]); num_vertexes++; - if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end) + if(list_position >= list_end) { + cmd = -1; + goto breakloop; + } + if((*list_position & 0xf000f000) == 0x50005000) break; } -- cgit v1.2.3