summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2017-05-11 15:17:42 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-05-24 17:18:04 +0000
commit63ff5727a24319fb0625deefe5a5b9c804390192 (patch)
tree95ab0779ef76842fd143861fb7b6d4b6a3ee1a6f
parent1f2842c5c7050cae94ff2f747d28ea54fcf871a3 (diff)
downloadandroid_external_sonivox-63ff5727a24319fb0625deefe5a5b9c804390192.tar.gz
android_external_sonivox-63ff5727a24319fb0625deefe5a5b9c804390192.tar.bz2
android_external_sonivox-63ff5727a24319fb0625deefe5a5b9c804390192.zip
Fix infinite recursion
Bug: 36725407 Test: decoded poc and other files with and without fix Change-Id: I9e23b2dbf133321bb01ae47c39761e17e46bd846 (cherry picked from commit ede62341663cf356edb20e3d14424aec767ea66b)
-rw-r--r--arm-wt-22k/lib_src/eas_xmf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arm-wt-22k/lib_src/eas_xmf.c b/arm-wt-22k/lib_src/eas_xmf.c
index 830b6e5..169eb7e 100644
--- a/arm-wt-22k/lib_src/eas_xmf.c
+++ b/arm-wt-22k/lib_src/eas_xmf.c
@@ -27,6 +27,8 @@
*----------------------------------------------------------------------------
*/
+#include <log/log.h>
+
#include "eas_data.h"
#include "eas_miditypes.h"
#include "eas_parser.h"
@@ -649,6 +651,11 @@ static EAS_RESULT XMF_ReadNode (EAS_HW_DATA_HANDLE hwInstData, S_XMF_DATA *pXMFD
for ( ; numItems > 0; numItems--)
{
/* process this item */
+ if (offset <= nodeOffset) {
+ ALOGE("b/36725407: parser did not advance");
+ return EAS_ERROR_FILE_FORMAT;
+ }
+
if ((result = XMF_ReadNode(hwInstData, pXMFData, offset, &length)) != EAS_SUCCESS)
return result;