diff options
Diffstat (limited to '3rdparty/libjpeg/jdatasrc.c')
-rw-r--r-- | 3rdparty/libjpeg/jdatasrc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/3rdparty/libjpeg/jdatasrc.c b/3rdparty/libjpeg/jdatasrc.c index c8fe3daf336..2a27cfed809 100644 --- a/3rdparty/libjpeg/jdatasrc.c +++ b/3rdparty/libjpeg/jdatasrc.c @@ -2,7 +2,7 @@ * jdatasrc.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2009-2010 by Guido Vollbeding. + * Modified 2009-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -121,16 +121,17 @@ fill_input_buffer (j_decompress_ptr cinfo) METHODDEF(boolean) fill_mem_input_buffer (j_decompress_ptr cinfo) { - static JOCTET mybuffer[4]; + static const JOCTET mybuffer[4] = { + (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0 + }; /* The whole JPEG data is expected to reside in the supplied memory * buffer, so any request for more data beyond the given buffer size * is treated as an error. */ WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ - mybuffer[0] = (JOCTET) 0xFF; - mybuffer[1] = (JOCTET) JPEG_EOI; cinfo->src->next_input_byte = mybuffer; cinfo->src->bytes_in_buffer = 2; @@ -246,7 +247,7 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) GLOBAL(void) jpeg_mem_src (j_decompress_ptr cinfo, - unsigned char * inbuffer, unsigned long insize) + const unsigned char * inbuffer, unsigned long insize) { struct jpeg_source_mgr * src; @@ -270,5 +271,5 @@ jpeg_mem_src (j_decompress_ptr cinfo, src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->term_source = term_source; src->bytes_in_buffer = (size_t) insize; - src->next_input_byte = (JOCTET *) inbuffer; + src->next_input_byte = (const JOCTET *) inbuffer; } |