Skip to content

Commit

Permalink
Fix crash when saving state without a kit loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed May 9, 2015
1 parent f6e1a21 commit a593de0
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions drmr.c
Expand Up @@ -442,16 +442,18 @@ save_state(LV2_Handle instance,
return LV2_STATE_ERR_NO_FEATURE;
}

char* mapped_path = map_path->abstract_path(map_path->handle,
drmr->current_path);

stat = store(handle,
drmr->uris.kit_path,
mapped_path,
strlen(mapped_path) + 1,
drmr->uris.string_urid,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
if (stat) return stat;
if (drmr->current_path != NULL) {
char* mapped_path = map_path->abstract_path(map_path->handle,
drmr->current_path);

stat = store(handle,
drmr->uris.kit_path,
mapped_path,
strlen(mapped_path) + 1,
drmr->uris.string_urid,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
if (stat) return stat;
}

flag = drmr->ignore_velocity?1:0;
stat = store(handle,
Expand Down

0 comments on commit a593de0

Please sign in to comment.