Skip to content

Commit 5157f83

Browse files
jmtriviandi34
authored andcommitted
Fix aacDecoder_drcExtractAndMap()
Parse DVB DRC data only when numThreads is below MAX_DRC_THREADS. The post-increment is necessary as it is used in fill element DRC data section. This solution parses as many DRC payloads as allowed by MAX_DRC_THREADS and skips all remaining DRC elements in the stream. Bug 27792766 Bug 26751339 Change-Id: Ie1641888bac1757c4d1491119f977fc5d436eaea (cherry picked from commit 97a1b81)
1 parent df09a70 commit 5157f83

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

libAACdec/src/aacdec_drc.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -680,11 +680,7 @@ static int aacDecoder_drcExtractAndMap (
680680
}
681681
self->numPayloads = 0;
682682

683-
if (self->numThreads >= MAX_DRC_THREADS) {
684-
self->numThreads = MAX_DRC_THREADS - 1;
685-
}
686-
687-
if (self->dvbAncDataAvailable)
683+
if (self->dvbAncDataAvailable && self->numThreads < MAX_DRC_THREADS)
688684
{ /* Append a DVB heavy compression payload thread if available. */
689685
int bitsParsed;
690686

@@ -710,10 +706,6 @@ static int aacDecoder_drcExtractAndMap (
710706

711707
/* coupling channels not supported */
712708

713-
if (self->numThreads >= MAX_DRC_THREADS) {
714-
self->numThreads = MAX_DRC_THREADS - 1;
715-
}
716-
717709
/* check for valid threads */
718710
for (thread = 0; thread < self->numThreads; thread++) {
719711
CDrcPayload *pThreadBs = &threadBs[thread];

0 commit comments

Comments
 (0)