[Swfdec-commits] 3 commits - swfdec/jpeg

Benjamin Otte company at kemper.freedesktop.org
Wed Sep 24 09:05:16 PDT 2008


 swfdec/jpeg/jpeg.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 0557b44d36c800380a112677d15597825b4f5a42
Author: Riccardo Magliocchetti <riccardo at datahost.it>
Date:   Wed Sep 24 18:03:25 2008 +0200

    mem leak: free error message

diff --git a/swfdec/jpeg/jpeg.c b/swfdec/jpeg/jpeg.c
index 57a593c..7d967db 100644
--- a/swfdec/jpeg/jpeg.c
+++ b/swfdec/jpeg/jpeg.c
@@ -559,6 +559,8 @@ jpeg_decoder_free (JpegDecoder * dec)
 
   if (dec->data)
     free (dec->data);
+  if (dec->error_message)
+    free (dec->error_message);
 
   free (dec);
 }
commit 775ff08ed0d15e25ea1c4d0f97fb3b2efb4192ae
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Sep 24 17:43:07 2008 +0200

    ensure the huffman table does not exceed 256 entries (fixes #17589)

diff --git a/swfdec/jpeg/jpeg.c b/swfdec/jpeg/jpeg.c
index d739e50..57a593c 100644
--- a/swfdec/jpeg/jpeg.c
+++ b/swfdec/jpeg/jpeg.c
@@ -264,6 +264,12 @@ huffman_table_init_jpeg (JpegDecoder *decoder, HuffmanTable *table, JpegBits * b
     n_symbols += huffsize[i];
   }
 
+  /* There may be a maximum of 256 symbols in the table. */
+  if (n_symbols > 256) {
+    jpeg_decoder_error (decoder, "%u Huffman table entries exceeds 256", n_symbols);
+    return -1;
+  }
+
   /* Build up the symbol table.  The first symbol is all 0's, with
    * the number of bits determined by the first non-zero entry in
    * huffsize[].  Subsequent symbols with the same bit length are
commit 96f9dc9781cf04a2da932bd94565bc9a68f6195d
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Sep 24 16:51:57 2008 +0200

    get rid of unused variable

diff --git a/swfdec/jpeg/jpeg.c b/swfdec/jpeg/jpeg.c
index ef895e4..d739e50 100644
--- a/swfdec/jpeg/jpeg.c
+++ b/swfdec/jpeg/jpeg.c
@@ -248,7 +248,7 @@ huffman_table_init_jpeg (JpegDecoder *decoder, HuffmanTable *table, JpegBits * b
 {
   int n_symbols;
   int huffsize[16];
-  int i, j, k;
+  int i, j;
   unsigned int symbol;
   int n = 0;
 
@@ -270,13 +270,11 @@ huffman_table_init_jpeg (JpegDecoder *decoder, HuffmanTable *table, JpegBits * b
    * incremented by 1.  Increasing the bit length shifts the
    * symbol 1 bit to the left. */
   symbol = 0;
-  k = 0;
   for (i = 0; i < 16; i++) {
     for (j = 0; j < huffsize[i]; j++) {
       huffman_table_add (table, symbol, i + 1, jpeg_bits_get_u8 (bits));
       n++;
       symbol++;
-      k++;
     }
     /* This checks that our symbol is actually less than the
      * number of bits we think it is.  This is only triggered


More information about the Swfdec-commits mailing list