From c1c9f3b7fe54c5cb614bf9bf153660246aec2f3b Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 27 Jun 2022 14:04:20 +0300 Subject: [PATCH] stb_image_write.h: applied mainstream PR/1337 patch fixes potential invalid memory access https://github.com/nothings/stb/pull/1337 --- Linux/sgml/Quakespasm.sgml | 1 + Quake/stb_image_write.h | 2 +- Quakespasm.html | 6 +++--- Quakespasm.txt | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Linux/sgml/Quakespasm.sgml b/Linux/sgml/Quakespasm.sgml index ddf3d576..28871c0e 100644 --- a/Linux/sgml/Quakespasm.sgml +++ b/Linux/sgml/Quakespasm.sgml @@ -139,6 +139,7 @@ QuakeSpasm 0.94.0 has initial support for playing the 2021 re-release content: C Changes in 0.94.6

Server protocol size check fixes for sounds and particles. + An invalid memory access fix in the jpg screenshot writer. Backported a few fixes to the bundled SDL2-2.0.22 version. Minor build fix for C++ compilers. diff --git a/Quake/stb_image_write.h b/Quake/stb_image_write.h index d5904438..260b0b42 100644 --- a/Quake/stb_image_write.h +++ b/Quake/stb_image_write.h @@ -381,7 +381,7 @@ static int stbiw__jpg_processDU(stbi__write_context *s, int *bitBuf, int *bitCnt int startpos = i; int nrzeroes; unsigned short bits[2]; - for (; DU[i]==0 && i<=end0pos; ++i) { + for (; i<=end0pos && DU[i]==0; ++i) { } nrzeroes = i-startpos; if ( nrzeroes >= 16 ) { diff --git a/Quakespasm.html b/Quakespasm.html index e980e5b7..4b88e245 100644 --- a/Quakespasm.html +++ b/Quakespasm.html @@ -18,14 +18,13 @@

3. Hints

- +

4. Compiling and Installation

-

-

5. Changes

+

5. Changes