3a5d31716bb34526d02e20db823e8d5d0ae4a7d4 braney Mon Mar 27 14:36:58 2023 -0700 some more error checking in the routine that collapses squishyPack tracks into a single imgTrack. diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c index bef93c4..be3b5b0 100644 --- src/hg/hgTracks/imageV2.c +++ src/hg/hgTracks/imageV2.c @@ -1990,30 +1990,34 @@ struct imgTrack *smashSquish(struct imgTrack *imgTrackList) /* Javascript doesn't know about our trick to do squishyPack so we need to pass it a single div instead of two. * We assume that the linked track immediately follows the original track in the sorted list. */ { struct imgTrack *nextImg, *imgTrack; for (imgTrack = imgTrackList; imgTrack!=NULL;imgTrack = nextImg) { nextImg = imgTrack->next; boolean joinNext = ((nextImg != NULL) && nextImg->linked); if (joinNext) // Smash these together { struct imgSlice *packedSlices = imgTrack->slices; struct imgSlice *squishSlices = imgTrack->next->slices; + + if ((packedSlices == NULL) || (squishSlices == NULL) || + (slCount(packedSlices) != slCount(squishSlices))) + continue; for(; packedSlices && squishSlices; packedSlices = packedSlices->next, squishSlices = squishSlices->next) { if (packedSlices->type != stCenter) { if ((packedSlices->map != NULL) && (squishSlices->map != NULL)) packedSlices->map->items = slCat(packedSlices->map->items, squishSlices->map->items); packedSlices->height += squishSlices->height; } } imgTrack->next = nextImg->next; nextImg = nextImg->next; } } return imgTrackList;