summaryrefslogtreecommitdiffstats
path: root/decoder
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2015-08-05 11:35:47 +0530
committerMarco Nelissen <marcone@google.com>2015-10-09 11:44:25 -0700
commit3d2ea5037ccc3cd4b08f957dff4d342e84a77284 (patch)
tree65d6d9bedad59b38788abc33b62df760964611b9 /decoder
parent19ca88ac53cd7dceffca5e7468d1b8852c852ae6 (diff)
downloadandroid_external_libhevc-3d2ea5037ccc3cd4b08f957dff4d342e84a77284.tar.gz
android_external_libhevc-3d2ea5037ccc3cd4b08f957dff4d342e84a77284.tar.bz2
android_external_libhevc-3d2ea5037ccc3cd4b08f957dff4d342e84a77284.zip
Fixed an out of bound read in accessing inverse scan table
Change-Id: Ib25db1da92eee390a3847df06c0c0675ebcfb1a4
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ihevcd_parse_residual.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/decoder/ihevcd_parse_residual.c b/decoder/ihevcd_parse_residual.c
index fc84fa3..6e2a39c 100644
--- a/decoder/ihevcd_parse_residual.c
+++ b/decoder/ihevcd_parse_residual.c
@@ -191,7 +191,7 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec,
bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
WORD32 last_significant_coeff_x_prefix, last_significant_coeff_y_prefix;
WORD32 last_significant_coeff_x, last_significant_coeff_y;
- const UWORD8 *pu1_scan_blk, *pu1_scan_coeff;
+ const UWORD8 *pu1_scan_blk = NULL, *pu1_scan_coeff;
WORD32 scan_idx;
WORD32 i;
WORD32 sign_data_hiding_flag;
@@ -387,7 +387,8 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec,
last_scan_pos = pu1_scan_coeff[scan_pos];
}
- pu1_scan_blk = (UWORD8 *)gapv_ihevc_invscan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
+ if(log2_trafo_size > 2)
+ pu1_scan_blk = (UWORD8 *)gapv_ihevc_invscan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
pu1_scan_coeff = &gau1_ihevc_invscan4x4[scan_idx][0];
/* Set CSBF array to zero */