After much gnashing of teeth, I located a problem encoding in amf_write_array. The issue was that I was freeing indexAsString before I was done using it:
I'm not sure if memory for this _char is allocated by spprintf or whether I should be approaching this in some other way. The basic idea is that I need to transform a ulong, _index* into a string. E.g., the ulong 1 becomes "1" so that I can write it as a string to the buffer. Please see code here for reference:
https://github.com/sneakyimp/amfext/blob/master/amf.c#L945
@Sean-Der any chance you could recommend how to allocate this char* and then dispose of it properly once we've encoded all the associative keys?
After much gnashing of teeth, I located a problem encoding in amf_write_array. The issue was that I was freeing indexAsString before I was done using it:
I'm not sure if memory for this _char is allocated by spprintf or whether I should be approaching this in some other way. The basic idea is that I need to transform a ulong, _index* into a string. E.g., the ulong 1 becomes "1" so that I can write it as a string to the buffer. Please see code here for reference:
https://github.com/sneakyimp/amfext/blob/master/amf.c#L945
@Sean-Der any chance you could recommend how to allocate this char* and then dispose of it properly once we've encoded all the associative keys?