]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix an extremely rare crash that can occur when compressing a very high-frequency...
authorDRC <dcommander@users.sourceforge.net>
Thu, 21 Aug 2014 01:55:22 +0000 (01:55 +0000)
committerDRC <dcommander@users.sourceforge.net>
Thu, 21 Aug 2014 01:55:22 +0000 (01:55 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1365 632fc199-4ca6-4c93-a231-07263d6284db

jchuff.c

index 5afeb194346dd89011a6a9256a96b2cae7a1c562..648d3fd2304d34b7b1d8fbd61e6741b876f231ad 100644 (file)
--- a/jchuff.c
+++ b/jchuff.c
@@ -4,7 +4,7 @@
  * This file was part of the Independent JPEG Group's software:
  * Copyright (C) 1991-1997, Thomas G. Lane.
  * libjpeg-turbo Modifications:
- * Copyright (C) 2009-2011, D. R. Commander.
+ * Copyright (C) 2009-2011, 2014 D. R. Commander.
  * For conditions of distribution and use, see the accompanying README file.
  *
  * This file contains Huffman entropy encoding routines.
@@ -426,7 +426,7 @@ dump_buffer (working_state * state)
 LOCAL(boolean)
 flush_bits (working_state * state)
 {
-  JOCTET _buffer[BUFSIZE], *buffer;
+  JOCTET _buffer[BUFSIZE + 8], *buffer;
   size_t put_buffer;  int put_bits;
   size_t bytes, bytestocopy;  int localbuf = 0;
 
@@ -455,7 +455,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
   int temp, temp2, temp3;
   int nbits;
   int r, code, size;
-  JOCTET _buffer[BUFSIZE], *buffer;
+  JOCTET _buffer[BUFSIZE + 8], *buffer;
   size_t put_buffer;  int put_bits;
   int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];
   size_t bytes, bytestocopy;  int localbuf = 0;