The size of array huffman_table only 2 in VAHuffmanTableBufferJPEGBaseline.
The index in 2..3 in huffman_table[x] will be access invalid memory
location.

Signed-off-by: Lim Siew Hoon <[email protected]>
---
 test/decode/tinyjpeg-internal.h | 2 +-
 test/decode/tinyjpeg.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/decode/tinyjpeg-internal.h b/test/decode/tinyjpeg-internal.h
index 6801c31..74ad197 100644
--- a/test/decode/tinyjpeg-internal.h
+++ b/test/decode/tinyjpeg-internal.h
@@ -44,7 +44,7 @@ struct jdec_private;
 
 #define HUFFMAN_BITS_SIZE  256
 
-#define HUFFMAN_TABLES    4
+#define HUFFMAN_TABLES    2
 #define COMPONENTS        4
 #define JPEG_MAX_WIDTH    2048
 #define JPEG_MAX_HEIGHT           2048
diff --git a/test/decode/tinyjpeg.c b/test/decode/tinyjpeg.c
index 6b5435d..103cba3 100644
--- a/test/decode/tinyjpeg.c
+++ b/test/decode/tinyjpeg.c
@@ -157,7 +157,7 @@ static int build_default_huffman_tables(struct jdec_private 
*priv)
     if (priv->default_huffman_table_initialized)
         return 0;
 
-    for (i = 0; i < 4; i++) {
+    for (i = 0; i < 2; i++) {
         priv->HTDC_valid[i] = 1;
         memcpy(priv->HTDC[i].bits, 
default_huffman_table_param.huffman_table[i].num_dc_codes,
                
sizeof(default_huffman_table_param.huffman_table[i].num_dc_codes));
-- 
2.1.0

_______________________________________________
Libva mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libva

Reply via email to