diff options
author | notaz | 2013-01-06 03:55:09 +0200 |
---|---|---|
committer | notaz | 2013-01-06 03:55:09 +0200 |
commit | 804789d73ee66857216f1e32c74c80dd65ef587f (patch) | |
tree | 1ac3def21d54318e5ec894fee2e99bf71567c0d8 /plugins/gpu_unai | |
parent | 1f84e117ae9b49f6ed72c7243fd514dd1a9e581b (diff) | |
download | pcsx_rearmed-804789d73ee66857216f1e32c74c80dd65ef587f.tar.gz pcsx_rearmed-804789d73ee66857216f1e32c74c80dd65ef587f.tar.bz2 pcsx_rearmed-804789d73ee66857216f1e32c74c80dd65ef587f.zip |
gpus: handle list underflows better
Diffstat (limited to 'plugins/gpu_unai')
-rw-r--r-- | plugins/gpu_unai/gpulib_if.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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; } |