Skip to content

Commit 1234ee6

Browse files
marconeandi34
authored andcommitted
Fix infinite recursion
Bug: 36725407 Test: decoded poc and other files with and without fix AOSP-Change-Id: I9e23b2dbf133321bb01ae47c39761e17e46bd846 (cherry picked from commit ede62341663cf356edb20e3d14424aec767ea66b) Change-Id: I5814c2aa0ff0256583fc3725b75934f883b65593
1 parent 5e0e9db commit 1234ee6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arm-wt-22k/lib_src/eas_xmf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*----------------------------------------------------------------------------
2828
*/
2929

30+
#include <log/log.h>
31+
3032
#include "eas_data.h"
3133
#include "eas_miditypes.h"
3234
#include "eas_parser.h"
@@ -646,6 +648,11 @@ static EAS_RESULT XMF_ReadNode (EAS_HW_DATA_HANDLE hwInstData, S_XMF_DATA *pXMFD
646648
for ( ; numItems > 0; numItems--)
647649
{
648650
/* process this item */
651+
if (offset <= nodeOffset) {
652+
ALOGE("b/36725407: parser did not advance");
653+
return EAS_ERROR_FILE_FORMAT;
654+
}
655+
649656
if ((result = XMF_ReadNode(hwInstData, pXMFData, offset, &length)) != EAS_SUCCESS)
650657
return result;
651658

0 commit comments

Comments
 (0)