@louis, I’m stumped, I’ll admit.
The good news is that converting the last arrays to malloc fixes the problem of code integration and crash at start.
The bad news is that standalone animatedgifs does not do the right thing anymore when I switch those 2 vars to malloc:
// Buffer image data is decoded into
//uint8_t *imageData = (uint8_t *) malloc(maxGifWidth * maxGifHeight);
uint8_t imageData[maxGifWidth * maxGifHeight];
// Backup image data buffer for saving portions of image disposal method == 3
//uint8_t *imageDataBU = (uint8_t *) malloc(maxGifWidth * maxGifHeight);;
uint8_t imageDataBU[maxGifWidth * maxGifHeight];
See patch:
It’s not a malloc failure problem, I just moved the malloc inline with where the arrays are defined, just to make sure I’m not doing it wrong.
Maybe the malloc pointer somehow is in a location that can’t be accessed from where the code needs it later? (given that ESP32 has multiple memory regions it seems)
Can you guess what’s going on better than me?
From what I can tell, I am not out of RAM
Malloc stack in GifDecoder startDecoding. Requested bytes: 4096
Malloc prefix in GifDecoder startDecoding. Requested bytes: 8192
Malloc suffix in GifDecoder startDecoding. Requested bytes: 4096
Malloc palette in GifDecoder startDecoding. Requested bytes: 768
Malloc tempBuffer in GifDecoder startDecoding. Requested bytes: 260
Heap Memory Available: 241984 bytes total, 113792 bytes largest free block:
8-bit Accessible Memory Available: 153764 bytes total, 113792 bytes largest free block:
32-bit Memory Available: 241984 bytes total, 113792 bytes largest free block:
DMA Memory Available: 153764 bytes total, 113792 bytes largest free block: