mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-02-17 03:30:35 +01:00
Add sanity check in huff_decode()
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Bug: 119292397 Change-Id: I33e99629665df9aa6262c90dd7ebdde4b4b9d773 (cherry picked from commit b81f869de3f7c5b6395606d5f36cef57987eae8f)
This commit is contained in:
parent
69514bb308
commit
da401d271e
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user