EXC_BAD_ACCESS on ofPixels.swapRgb() in ofImage::saveImage()

When saving an image from getting pixels from the ofFbo it is produced a weird issue that app crash with EXC_BAD_ACCESS / KERN_INVALID_ADDRESS. This is the crash log that printed when the application gets crashed. Please, help me to sort out this issue.

And I have looked a similar issue https://forum.openframeworks.cc/t/exc-bad-access-on-ofpixels-swaprgb-in-ofimage-loadimage-with-640x480-img even I can’t able to solve this.

ofPixels_::swapRgb() (type_traits:3599) // it is crahes here.
void saveImage(ofPixels_&, std::__1::basic_string<char, std::__1::char_traits, std::_1::allocator >, ofImageQualityType) (ofImage.cpp:337)
ofSaveImage(ofPixels
&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, ofImageQualityType) (ofImage.cpp:392)