Okay:
ostringstream outputBuffer( ostringstream::out | ostringstream::binary ); // Output buffer to store decoded ICN frame pixels
Decoding example:
const unsigned char transparentPixel[] = { 0, 0, 0, 0 };
outputBuffer.write( (const char *)transparentPixel, 4 );
Now it didn't throw any null pointer error, althought the output it's still the same: bluish image on sfml screen, but correct pixels in output file.
This is giving me headache lol....