From e6d06460f6936adaf2c5df783700a683fd082878 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Fri, 16 Dec 2011 08:33:36 -0800 Subject: Fix crash when scanning corrupt midi file. b/5453816 Change-Id: Ic2104fc0b86ef0b5ec3af7a009b193f85690d291 --- arm-wt-22k/lib_src/eas_smf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arm-wt-22k/lib_src/eas_smf.c b/arm-wt-22k/lib_src/eas_smf.c index 9e096b6..7b0bdd8 100644 --- a/arm-wt-22k/lib_src/eas_smf.c +++ b/arm-wt-22k/lib_src/eas_smf.c @@ -281,6 +281,11 @@ EAS_RESULT SMF_Event (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_INT pars if (pSMFData->state >= EAS_STATE_OPEN) return EAS_SUCCESS; + if (!pSMFData->nextStream) { + return EAS_ERROR_FILE_FORMAT; + } + + /* get current ticks */ ticks = pSMFData->nextStream->ticks; -- cgit v1.1