aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-05 01:53:51 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-05 01:53:51 +0000
commit87820b2475b872a7658e0adac8c02ebff9466056 (patch)
treeb9ce6ce1f5f3d0a4936db3b5b87deaa5064e80f3
parent44e7ae4d1ebb26df0e767b379afdc8e02475422f (diff)
parent6c72374eeaf99e2b9db1c8cb5c9f945311317a1c (diff)
downloadfdk-aac-87820b2475b872a7658e0adac8c02ebff9466056.tar.gz
fdk-aac-87820b2475b872a7658e0adac8c02ebff9466056.tar.bz2
fdk-aac-87820b2475b872a7658e0adac8c02ebff9466056.zip
Snap for 5524043 from 6c72374eeaf99e2b9db1c8cb5c9f945311317a1c to pi-platform-release
Change-Id: Ibe2a6ddf5f388db0403be3d99676aa0384d4094c
-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) {