From 6620d99fbb62fb741980323ba0a451f95b2a467f Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 8 Nov 2016 15:27:45 +0100 Subject: [PATCH] Fix frame buffer bounds and access errors --- src/r_poly.cpp | 1 + src/r_poly_triangle.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/r_poly.cpp b/src/r_poly.cpp index 6542afcfb..bd9003fab 100644 --- a/src/r_poly.cpp +++ b/src/r_poly.cpp @@ -67,6 +67,7 @@ void RenderPolyBsp::Render() RenderSubsector(*it); RenderPlayerSprites(); + DrawerCommandQueue::WaitForWorkers(); RenderScreenSprites(); // To do: should be called by FSoftwareRenderer::DrawRemainingPlayerSprites instead of here } diff --git a/src/r_poly_triangle.cpp b/src/r_poly_triangle.cpp index 73c33d024..d44648551 100644 --- a/src/r_poly_triangle.cpp +++ b/src/r_poly_triangle.cpp @@ -425,7 +425,7 @@ void ScreenPolyTriangleDrawer::draw(const ScreenPolyTriangleDrawerArgs *args, Dr for (int ix = x; ix < x + q; ix++) { - bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy); + bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy); if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible) { @@ -594,7 +594,7 @@ void ScreenPolyTriangleDrawer::fill(const ScreenPolyTriangleDrawerArgs *args, Dr for (int ix = x; ix < x + q; ix++) { - bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy); + bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy); if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible) { @@ -819,7 +819,7 @@ void ScreenPolyTriangleDrawer::draw32(const ScreenPolyTriangleDrawerArgs *args, for (int ix = x; ix < x + q; ix++) { - bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy); + bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy); if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible) { @@ -995,7 +995,7 @@ void ScreenPolyTriangleDrawer::fill32(const ScreenPolyTriangleDrawerArgs *args, for (int ix = x; ix < x + q; ix++) { - bool visible = ix >= clipleft && ix <= clipright && (cliptop <= y + iy) && (clipbottom > y + iy); + bool visible = ix >= clipleft && ix < clipright && (cliptop <= y + iy) && (clipbottom > y + iy); if (CX1 > 0 && CX2 > 0 && CX3 > 0 && visible) {