[Libva] [PATCH 4/5] Fix size of array huffman_table to 2 instead 4.

Lim, Siew Hoon siew.hoon.lim at intel.com
Fri Jul 1 03:30:22 UTC 2016





> -----Original Message-----
> From: Xiang, Haihao
> Sent: Friday, July 01, 2016 1:02 AM
> To: Lim, Siew Hoon; libva at lists.freedesktop.org
> Subject: RE: [Libva] [PATCH 4/5] Fix size of array huffman_table to 2 instead 4.
> 
> 
> 
> >-----Original Message-----
> >From: Libva [mailto:libva-bounces at lists.freedesktop.org] On Behalf Of
> >Lim Siew Hoon
> >Sent: Tuesday, June 28, 2016 7:36 PM
> >To: libva at lists.freedesktop.org
> >Subject: [Libva] [PATCH 4/5] Fix size of array huffman_table to 2 instead 4.
> >
> >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.
> 
> Please do not change the size. For baseline, Tc and Th can be (0, 1).  You can
> use 'i % 2' as index to access  huffman_table[] in
> VAHuffmanTableBufferJPEGBaseline.
[Siew Hoon]  Ok. Done correct it in 
https://lists.freedesktop.org/archives/libva/2016-July/004116.html
The commit message title I also changed if this is the case. And new commit code totally different with this patch.

> 
> Thanks
> Haihao
> 
> >
> >Signed-off-by: Lim Siew Hoon <siew.hoon.lim at intel.com>
> >---
> > 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
> >Libva at lists.freedesktop.org
> >https://lists.freedesktop.org/mailman/listinfo/libva


More information about the Libva mailing list