diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index bec58a714..44da42f12 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -579,6 +579,9 @@ static uint8_t *writespecdata(const dataspec_t *spec, FILE *fil, uint8_t *dump) ds_get(sp, &ptr, &cnt); if (cnt < 0) { OSD_Printf("wsd: cnt=%d, f=0x%x.\n",cnt,sp->flags); continue; } + if (!ptr || !cnt) + continue; + if (fil) { if (((sp->flags&DS_CNTMASK)==0 && sp->size*cnt<=savegame_comprthres) @@ -644,6 +647,9 @@ static int32_t readspecdata(const dataspec_t *spec, int32_t fil, uint8_t **dumpv ds_get(sp, &ptr, &cnt); if (cnt < 0) { OSD_Printf("rsd: cnt<0... wtf?\n"); return -1; } + if (!ptr || !cnt) + continue; + if (fil>=0) { mem = (dump && (sp->flags&DS_NOCHK)==0) ? dump : (uint8_t *)ptr;