aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/src
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-04-16 06:06:05 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-04-16 06:06:05 +0000
commitd1918a47feed477782dc6c3c6a35d425c8345b46 (patch)
treeb9ce6ce1f5f3d0a4936db3b5b87deaa5064e80f3 /libFDK/src
parent69514bb3082c0f26a3684501240c982b79ecc22b (diff)
parentf996972c324486663d84a67f5a132aa65e0ba57b (diff)
downloadfdk-aac-d1918a47feed477782dc6c3c6a35d425c8345b46.tar.gz
fdk-aac-d1918a47feed477782dc6c3c6a35d425c8345b46.tar.bz2
fdk-aac-d1918a47feed477782dc6c3c6a35d425c8345b46.zip
Merge cherrypicks of [7068682, 7066360, 7066361, 7066362, 7068985, 7068986, 7068987, 7068800, 7068004] into pi-qpr3-b-release
Change-Id: I779161184ff3f9875b815efe88c9d12e046879e8
Diffstat (limited to 'libFDK/src')
-rw-r--r--libFDK/src/nlc_dec.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libFDK/src/nlc_dec.cpp b/libFDK/src/nlc_dec.cpp
index 8a8ccfd..6e98ce0 100644
--- a/libFDK/src/nlc_dec.cpp
+++ b/libFDK/src/nlc_dec.cpp
@@ -647,6 +647,10 @@ static ERROR_t huff_decode(HANDLE_FDK_BITSTREAM strm, SCHAR* out_data_1,
}
df_rest_flag_1 = num_val_1_int % 2;
if (df_rest_flag_1) num_val_1_int -= 1;
+ if (num_val_1_int < 0) {
+ err = HUFFDEC_NOTOK;
+ goto bail;
+ }
}
if (out_data_2 != NULL) {
if (diff_type_2 == DIFF_FREQ) {
@@ -658,6 +662,10 @@ static ERROR_t huff_decode(HANDLE_FDK_BITSTREAM strm, SCHAR* out_data_1,
}
df_rest_flag_2 = num_val_2_int % 2;
if (df_rest_flag_2) num_val_2_int -= 1;
+ if (num_val_2_int < 0) {
+ err = HUFFDEC_NOTOK;
+ goto bail;
+ }
}
if (out_data_1 != NULL) {