} else if (input_fmt == MM_UTIL_JPEG_FMT_GraySacle) {
decoded_data->size = dinfo.output_height * dinfo.output_width;
} else{
+ jpeg_finish_decompress(&dinfo);
jpeg_destroy_decompress(&dinfo);
mm_util_error("[%d] We can't decode the IMAGE format", input_fmt);
fclose(infile);
decoded_data->format = input_fmt;
if (decoded_data->data == NULL) {
+ jpeg_finish_decompress(&dinfo);
jpeg_destroy_decompress(&dinfo);
mm_util_error("decoded_data->data is NULL");
fclose(infile);
} else if (input_fmt == MM_UTIL_JPEG_FMT_GraySacle) {
decoded_data->size = dinfo.output_height * dinfo.output_width;
} else{
+ jpeg_finish_decompress(&dinfo);
jpeg_destroy_decompress(&dinfo);
mm_util_error("[%d] We can't decode the IMAGE format", input_fmt);
return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
decoded_data->format = input_fmt;
if (decoded_data->data == NULL) {
+ jpeg_finish_decompress(&dinfo);
jpeg_destroy_decompress(&dinfo);
mm_util_error("decoded_data->data is NULL");
return MM_UTIL_ERROR_OUT_OF_MEMORY;