mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-18 11:39:08 +00:00
Fix few more issues detected in MozJPEG wrapper
This commit is contained in:
committed by
Ingvar Stepanyan
parent
93cbe557cd
commit
39e5741cb2
@@ -103,8 +103,8 @@ val encode(std::string image_in, int image_width, int image_height, MozJpegOptio
|
|||||||
// fprintf(stderr, "can't open %s\n", filename);
|
// fprintf(stderr, "can't open %s\n", filename);
|
||||||
// exit(1);
|
// exit(1);
|
||||||
// }
|
// }
|
||||||
uint8_t* output;
|
uint8_t* output = nullptr;
|
||||||
unsigned long size;
|
unsigned long size = 0;
|
||||||
jpeg_mem_dest(&cinfo, &output, &size);
|
jpeg_mem_dest(&cinfo, &output, &size);
|
||||||
|
|
||||||
/* Step 3: set parameters for compression */
|
/* Step 3: set parameters for compression */
|
||||||
@@ -203,6 +203,7 @@ val encode(std::string image_in, int image_width, int image_height, MozJpegOptio
|
|||||||
|
|
||||||
/* This is an important step since it will release a good deal of memory. */
|
/* This is an important step since it will release a good deal of memory. */
|
||||||
jpeg_destroy_compress(&cinfo);
|
jpeg_destroy_compress(&cinfo);
|
||||||
|
free(output);
|
||||||
|
|
||||||
/* And we're done! */
|
/* And we're done! */
|
||||||
return js_result;
|
return js_result;
|
||||||
|
|||||||
Reference in New Issue
Block a user