diff options
author | Marco Nelissen <marcone@google.com> | 2017-05-11 15:17:42 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2017-05-11 22:47:14 +0000 |
commit | ede62341663cf356edb20e3d14424aec767ea66b (patch) | |
tree | 2079778ed9276dc8661874399f393c7b25233212 | |
parent | 1ad130fc93ae5d472aa1bf75b9f29fe41b18eea9 (diff) | |
download | sonivox-ede62341663cf356edb20e3d14424aec767ea66b.tar.gz |
Fix infinite recursion
Bug: 36725407
Test: decoded poc and other files with and without fix
Change-Id: I9e23b2dbf133321bb01ae47c39761e17e46bd846
-rw-r--r-- | arm-wt-22k/lib_src/eas_xmf.c | 7 |
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; |