soundtrigger: add size check on sound model and recogntion data

Bug: 30148546

Change-Id: I082f535a853c96571887eeea37c6d41ecee7d8c0
(cherry picked from commit bb00d8f139ff51336ab3c810d35685003949bcf8)
(cherry picked from commit ef0c91518446e65533ca8bab6726a845f27c73fd)

void SoundTriggerHwService::soundModelCallback(struct sound_trigger_model_event *event,
 void *cookie)
{
 Module *module = (Module *)cookie;
 if (module == NULL) {
 return;
 }
    sp<SoundTriggerHwService> service = module->service().promote();
 if (service == 0) {
 return;
 }

    service->sendSoundModelEvent(event, module);
}

void SoundTriggerHwService::soundModelCallback(struct sound_trigger_model_event *event,
 void *cookie)
{
 Module *module = (Module *)cookie;
 if (module == NULL) {
 return;
 }
    sp<SoundTriggerHwService> service = module->service().promote();
 if (service == 0) {
 return;
 }

    service->sendSoundModelEvent(event, module);
}
