Hi,
I think this is a mistake leading to crash
static void nsvg__deleteGradientData(NSVGgradientData* grad) { NSVGgradientData* next; while (grad != NULL) { next = grad->next; free(grad->stops); free(grad); grad = next; } }
the line "free(grad->stops)" is wrong because stops not allocated, the pointer is assigned to array.
There is allocation for whole grad
grad = (NSVGgradient*)AllocateZeroPool(sizeof(NSVGgradient) + sizeof(NSVGgradientStop)*(nstops-1));
We can't free a part of the array.
Hi, I think this is a mistake leading to crash
static void nsvg__deleteGradientData(NSVGgradientData* grad) { NSVGgradientData* next; while (grad != NULL) { next = grad->next; free(grad->stops); free(grad); grad = next; } }
the line "free(grad->stops)" is wrong because stops not allocated, the pointer is assigned to array. There is allocation for whole gradgrad = (NSVGgradient*)AllocateZeroPool(sizeof(NSVGgradient) + sizeof(NSVGgradientStop)*(nstops-1));
We can't free a part of the array.