mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-06-05 22:39:13 +02:00
Merge changes I5eb0f88a,I1d853414
* changes: Fix unsigned integer overflow in Hcr_State_BODY_SIGN_ESC__ESC_WORD(). Validate DRC compression factor and DRC boost factor value range in aacDecoder_SetParam().
This commit is contained in:
committed by
Android (Google) Code Review
commit
04d0fa42ff
@@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
||||||
|
|
||||||
© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
||||||
Forschung e.V. All rights reserved.
|
Forschung e.V. All rights reserved.
|
||||||
|
|
||||||
1. INTRODUCTION
|
1. INTRODUCTION
|
||||||
@@ -173,7 +173,9 @@ void DecodeNonPCWs(HANDLE_FDK_BITSTREAM bs, H_HCR_INFO pHcr) {
|
|||||||
pHcr->segmentInfo.readDirection = FROM_RIGHT_TO_LEFT;
|
pHcr->segmentInfo.readDirection = FROM_RIGHT_TO_LEFT;
|
||||||
|
|
||||||
/* Process sets subsequently */
|
/* Process sets subsequently */
|
||||||
|
numSet = fMin(numSet, (UCHAR)MAX_HCR_SETS);
|
||||||
for (currentSet = 1; currentSet < numSet; currentSet++) {
|
for (currentSet = 1; currentSet < numSet; currentSet++) {
|
||||||
|
|
||||||
/* step 1 */
|
/* step 1 */
|
||||||
numCodeword -=
|
numCodeword -=
|
||||||
*pNumSegment; /* number of remaining non PCWs [for all sets] */
|
*pNumSegment; /* number of remaining non PCWs [for all sets] */
|
||||||
|
@@ -822,6 +822,9 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_SetParam(
|
|||||||
|
|
||||||
case AAC_DRC_ATTENUATION_FACTOR:
|
case AAC_DRC_ATTENUATION_FACTOR:
|
||||||
/* DRC compression factor (where 0 is no and 127 is max compression) */
|
/* DRC compression factor (where 0 is no and 127 is max compression) */
|
||||||
|
if ((value < 0) || (value > 127)) {
|
||||||
|
return AAC_DEC_SET_PARAM_FAIL;
|
||||||
|
}
|
||||||
errorStatus = aacDecoder_drcSetParam(hDrcInfo, DRC_CUT_SCALE, value);
|
errorStatus = aacDecoder_drcSetParam(hDrcInfo, DRC_CUT_SCALE, value);
|
||||||
uniDrcErr = FDK_drcDec_SetParam(self->hUniDrcDecoder, DRC_DEC_COMPRESS,
|
uniDrcErr = FDK_drcDec_SetParam(self->hUniDrcDecoder, DRC_DEC_COMPRESS,
|
||||||
value * (FL2FXCONST_DBL(0.5f / 127.0f)));
|
value * (FL2FXCONST_DBL(0.5f / 127.0f)));
|
||||||
@@ -829,6 +832,9 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_SetParam(
|
|||||||
|
|
||||||
case AAC_DRC_BOOST_FACTOR:
|
case AAC_DRC_BOOST_FACTOR:
|
||||||
/* DRC boost factor (where 0 is no and 127 is max boost) */
|
/* DRC boost factor (where 0 is no and 127 is max boost) */
|
||||||
|
if ((value < 0) || (value > 127)) {
|
||||||
|
return AAC_DEC_SET_PARAM_FAIL;
|
||||||
|
}
|
||||||
errorStatus = aacDecoder_drcSetParam(hDrcInfo, DRC_BOOST_SCALE, value);
|
errorStatus = aacDecoder_drcSetParam(hDrcInfo, DRC_BOOST_SCALE, value);
|
||||||
uniDrcErr = FDK_drcDec_SetParam(self->hUniDrcDecoder, DRC_DEC_BOOST,
|
uniDrcErr = FDK_drcDec_SetParam(self->hUniDrcDecoder, DRC_DEC_BOOST,
|
||||||
value * (FL2FXCONST_DBL(0.5f / 127.0f)));
|
value * (FL2FXCONST_DBL(0.5f / 127.0f)));
|
||||||
|
Reference in New Issue
Block a user