Various blitter fixes, should fix 8088MPH Kefrens segmentation fault.
This commit is contained in:
@@ -133,7 +133,7 @@ sdl_blit_shim(int x, int y, int w, int h)
|
|||||||
params.y = y;
|
params.y = y;
|
||||||
params.w = w;
|
params.w = w;
|
||||||
params.h = h;
|
params.h = h;
|
||||||
if (!(!sdl_enabled || (h <= 0) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL))) memcpy(interpixels, &(buffer32->line[y][x]), h * (2048 + 64) * sizeof(uint32_t));
|
if (!(!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL))) memcpy(interpixels, &(buffer32->line[y][x]), h * (2048 + 64) * sizeof(uint32_t));
|
||||||
blitreq = 1;
|
blitreq = 1;
|
||||||
video_blit_complete();
|
video_blit_complete();
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ sdl_blit(int x, int y, int w, int h)
|
|||||||
{
|
{
|
||||||
SDL_Rect r_src;
|
SDL_Rect r_src;
|
||||||
|
|
||||||
if (!sdl_enabled || (h <= 0) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)) {
|
if (!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)) {
|
||||||
r_src.x = x;
|
r_src.x = x;
|
||||||
r_src.y = y;
|
r_src.y = y;
|
||||||
r_src.w = w;
|
r_src.w = w;
|
||||||
|
@@ -172,7 +172,7 @@ vnc_blit(int x, int y, int w, int h)
|
|||||||
uint32_t *p;
|
uint32_t *p;
|
||||||
int yy;
|
int yy;
|
||||||
|
|
||||||
if (h <= 0)
|
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (yy=0; yy<h; yy++) {
|
for (yy=0; yy<h; yy++) {
|
||||||
|
@@ -809,9 +809,7 @@ static void opengl_main(void* param)
|
|||||||
|
|
||||||
static void opengl_blit(int x, int y, int w, int h)
|
static void opengl_blit(int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
int yy;
|
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (thread == NULL) ||
|
||||||
|
|
||||||
if ((h <= 0) || (buffer32 == NULL) || (thread == NULL) ||
|
|
||||||
atomic_flag_test_and_set(&blit_info[write_pos].in_use))
|
atomic_flag_test_and_set(&blit_info[write_pos].in_use))
|
||||||
{
|
{
|
||||||
video_blit_complete();
|
video_blit_complete();
|
||||||
|
@@ -234,7 +234,7 @@ sdl_blit(int x, int y, int w, int h)
|
|||||||
SDL_Rect r_src;
|
SDL_Rect r_src;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!sdl_enabled || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)) {
|
if (!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)) {
|
||||||
video_blit_complete();
|
video_blit_complete();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user