aboutsummaryrefslogtreecommitdiff
path: root/games/sdlquake2/files/patch-gl_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/sdlquake2/files/patch-gl_image.c')
-rw-r--r--games/sdlquake2/files/patch-gl_image.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/games/sdlquake2/files/patch-gl_image.c b/games/sdlquake2/files/patch-gl_image.c
index f5cce181947b..9b4bbeef3e08 100644
--- a/games/sdlquake2/files/patch-gl_image.c
+++ b/games/sdlquake2/files/patch-gl_image.c
@@ -1,6 +1,14 @@
---- ./gl_image.c.orig Thu May 19 17:56:13 2005
-+++ ./gl_image.c Sun Feb 26 11:23:56 2006
-@@ -555,7 +555,7 @@
+--- gl_image.c.orig 2005-05-19 22:56:13.000000000 +0200
++++ gl_image.c 2012-04-29 07:01:09.000000000 +0200
+@@ -20,6 +20,7 @@
+
+ #include "gl_local.h"
+ #include <png.h>
++#include <pngpriv.h>
+ #include <jpeglib.h>
+ #include "redblack.h"
+
+@@ -555,7 +556,7 @@
size_t Pos;
} TPngFileBuffer;
@@ -9,7 +17,7 @@
{
TPngFileBuffer *PngFileBuffer=(TPngFileBuffer*)png_get_io_ptr(Png);
memcpy(buf,PngFileBuffer->Buffer+PngFileBuffer->Pos,size);
-@@ -1007,17 +1007,17 @@
+@@ -1007,24 +1008,24 @@
=================================================================
*/
@@ -30,3 +38,20 @@
{
cinfo->src->next_input_byte += (size_t) num_bytes;
+ cinfo->src->bytes_in_buffer -= (size_t) num_bytes;
+ }
+
+-void jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len)
++void local_jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len)
+ {
+ cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr));
+ cinfo->src->init_source = jpg_null;
+@@ -1065,7 +1066,7 @@
+
+ cinfo.err = jpeg_std_error(&jerr);
+ jpeg_create_decompress(&cinfo);
+- jpeg_mem_src(&cinfo, rawdata, rawsize);
++ local_jpeg_mem_src(&cinfo, rawdata, rawsize);
+ jpeg_read_header(&cinfo, true);
+ jpeg_start_decompress(&cinfo);
+