mirror of
				https://github.com/mstorsjo/fdk-aac.git
				synced 2025-06-05 22:39:13 +02:00 
			
		
		
		
	[automerger] DO NOT MERGE Prevent out of bounds accesses in lppTransposer() am: 2eaadebcb6 am: 589e1e861f
				
					
				
			Change-Id: I319554e07343c649f0ba37e719fbc144336b5e3e
This commit is contained in:
		| @@ -96,6 +96,10 @@ amm-info@iis.fraunhofer.de | |||||||
|   \sa lppTransposer(), main_audio.cpp, sbr_scale.h, \ref documentationOverview |   \sa lppTransposer(), main_audio.cpp, sbr_scale.h, \ref documentationOverview | ||||||
| */ | */ | ||||||
|  |  | ||||||
|  | #ifdef __ANDROID__ | ||||||
|  | #include <cutils/log.h> | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #include "lpp_tran.h" | #include "lpp_tran.h" | ||||||
|  |  | ||||||
| #include "sbr_ram.h" | #include "sbr_ram.h" | ||||||
| @@ -256,7 +260,6 @@ void lppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans,    /*!< Handle of lpp transp | |||||||
|   int ovLowBandShift; |   int ovLowBandShift; | ||||||
|   int lowBandShift; |   int lowBandShift; | ||||||
| /*  int ovHighBandShift;*/ | /*  int ovHighBandShift;*/ | ||||||
|   int targetStopBand; |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   alphai[0] = FL2FXCONST_SGL(0.0f); |   alphai[0] = FL2FXCONST_SGL(0.0f); | ||||||
| @@ -273,24 +276,32 @@ void lppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans,    /*!< Handle of lpp transp | |||||||
|  |  | ||||||
|   autoCorrLength = pSettings->nCols + pSettings->overlap; |   autoCorrLength = pSettings->nCols + pSettings->overlap; | ||||||
|  |  | ||||||
|   /* Set upper subbands to zero: |   if (pSettings->noOfPatches > 0) { | ||||||
|      This is required in case that the patches do not cover the complete highband |     /* Set upper subbands to zero: | ||||||
|      (because the last patch would be too short). |        This is required in case that the patches do not cover the complete highband | ||||||
|      Possible optimization: Clearing bands up to usb would be sufficient here. */ |        (because the last patch would be too short). | ||||||
|   targetStopBand = patchParam[pSettings->noOfPatches-1].targetStartBand |        Possible optimization: Clearing bands up to usb would be sufficient here. */ | ||||||
|                  + patchParam[pSettings->noOfPatches-1].numBandsInPatch; |     int targetStopBand = patchParam[pSettings->noOfPatches-1].targetStartBand | ||||||
|  |                    + patchParam[pSettings->noOfPatches-1].numBandsInPatch; | ||||||
|  |  | ||||||
|   int memSize = ((64) - targetStopBand) * sizeof(FIXP_DBL); |     int memSize = ((64) - targetStopBand) * sizeof(FIXP_DBL); | ||||||
|  |  | ||||||
|   if (!useLP) { |     if (!useLP) { | ||||||
|  |       for (i = startSample; i < stopSampleClear; i++) { | ||||||
|  |         FDKmemclear(&qmfBufferReal[i][targetStopBand], memSize); | ||||||
|  |         FDKmemclear(&qmfBufferImag[i][targetStopBand], memSize); | ||||||
|  |       } | ||||||
|  |     } else | ||||||
|     for (i = startSample; i < stopSampleClear; i++) { |     for (i = startSample; i < stopSampleClear; i++) { | ||||||
|       FDKmemclear(&qmfBufferReal[i][targetStopBand], memSize); |       FDKmemclear(&qmfBufferReal[i][targetStopBand], memSize); | ||||||
|       FDKmemclear(&qmfBufferImag[i][targetStopBand], memSize); |  | ||||||
|     } |     } | ||||||
|   } else |  | ||||||
|   for (i = startSample; i < stopSampleClear; i++) { |  | ||||||
|     FDKmemclear(&qmfBufferReal[i][targetStopBand], memSize); |  | ||||||
|   } |   } | ||||||
|  | #ifdef __ANDROID__ | ||||||
|  |   else { | ||||||
|  |     // Safetynet logging | ||||||
|  |     android_errorWriteLog(0x534e4554, "112160868"); | ||||||
|  |   } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   /* init bwIndex for each patch */ |   /* init bwIndex for each patch */ | ||||||
|   FDKmemclear(bwIndex, MAX_NUM_PATCHES*sizeof(INT)); |   FDKmemclear(bwIndex, MAX_NUM_PATCHES*sizeof(INT)); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user