diff options
author | Marco Nelissen <marcone@google.com> | 2017-05-11 14:43:54 -0700 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-24 17:17:18 +0000 |
commit | 1f2842c5c7050cae94ff2f747d28ea54fcf871a3 (patch) | |
tree | 54ad3570c9ae7bd78217f32bed443454c5fe4401 | |
parent | fc7c2b3b0c7a83858683689bc758928e4a7cfb1c (diff) | |
download | android_external_sonivox-1f2842c5c7050cae94ff2f747d28ea54fcf871a3.tar.gz android_external_sonivox-1f2842c5c7050cae94ff2f747d28ea54fcf871a3.tar.bz2 android_external_sonivox-1f2842c5c7050cae94ff2f747d28ea54fcf871a3.zip |
Check chunk size
to make sure we actually advance in the file
Bug: 37093318
Test: decoded poc and other files with and without change
Change-Id: I94cf65336ce4132c17c39b651dc520264f02a704
(cherry picked from commit f01750adb0558d1885c7d5a5c8900d2187d0d38d)
-rw-r--r-- | arm-wt-22k/lib_src/eas_mdls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arm-wt-22k/lib_src/eas_mdls.c b/arm-wt-22k/lib_src/eas_mdls.c index 296d783..8097ba4 100644 --- a/arm-wt-22k/lib_src/eas_mdls.c +++ b/arm-wt-22k/lib_src/eas_mdls.c @@ -785,6 +785,11 @@ static EAS_RESULT NextChunk (SDLS_SYNTHESIZER_DATA *pDLSData, EAS_I32 *pPos, EAS if ((result = EAS_HWGetDWord(pDLSData->hwInstData, pDLSData->fileHandle, pSize, EAS_FALSE)) != EAS_SUCCESS) return result; + if (*pSize < 0) { + ALOGE("b/37093318"); + return EAS_ERROR_FILE_FORMAT; + } + /* get form type for RIFF and LIST types */ if ((*pChunkType == CHUNK_RIFF) || (*pChunkType == CHUNK_LIST)) { |