From 5213272d378285371fe9e064d84bdc285c90daff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Thu, 8 Jan 2015 00:53:31 +0000 Subject: [PATCH] Declare inbuffer const --- jdatasrc.c | 4 ++-- jpeglib.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jdatasrc.c b/jdatasrc.c index bf70422ba..22a09c872 100644 --- a/jdatasrc.c +++ b/jdatasrc.c @@ -254,7 +254,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; @@ -278,6 +278,6 @@ 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; } #endif diff --git a/jpeglib.h b/jpeglib.h index a41bec44c..aec9180e9 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -919,7 +919,8 @@ EXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile); /* Data source and destination managers: memory buffers. */ EXTERN(void) jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer, unsigned long * outsize); -EXTERN(void) jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * inbuffer, +EXTERN(void) jpeg_mem_src (j_decompress_ptr cinfo, + const unsigned char * inbuffer, unsigned long insize); #endif