The extension argument to BKE_image_path_ext_from_imformat should be an array of pointers.
BKE_material.h
0dc484f9cc