mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
Merge "real fix for longjmp warning"
This commit is contained in:
commit
3fdaf4d28c
@ -213,7 +213,7 @@ int ReadJPEG(FILE* in_file, WebPPicture* const pic, Metadata* const metadata) {
|
|||||||
int stride, width, height;
|
int stride, width, height;
|
||||||
volatile struct jpeg_decompress_struct dinfo;
|
volatile struct jpeg_decompress_struct dinfo;
|
||||||
struct my_error_mgr jerr;
|
struct my_error_mgr jerr;
|
||||||
volatile uint8_t* rgb = NULL;
|
uint8_t* volatile rgb = NULL;
|
||||||
JSAMPROW buffer[1];
|
JSAMPROW buffer[1];
|
||||||
|
|
||||||
memset((j_decompress_ptr)&dinfo, 0, sizeof(dinfo)); // for setjmp sanity
|
memset((j_decompress_ptr)&dinfo, 0, sizeof(dinfo)); // for setjmp sanity
|
||||||
@ -272,11 +272,11 @@ int ReadJPEG(FILE* in_file, WebPPicture* const pic, Metadata* const metadata) {
|
|||||||
// WebP conversion.
|
// WebP conversion.
|
||||||
pic->width = width;
|
pic->width = width;
|
||||||
pic->height = height;
|
pic->height = height;
|
||||||
ok = WebPPictureImportRGB(pic, (const uint8_t*)rgb, stride);
|
ok = WebPPictureImportRGB(pic, rgb, stride);
|
||||||
if (!ok) goto Error;
|
if (!ok) goto Error;
|
||||||
|
|
||||||
End:
|
End:
|
||||||
free((void*)rgb);
|
free(rgb);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
#else // !WEBP_HAVE_JPEG
|
#else // !WEBP_HAVE_JPEG
|
||||||
|
@ -200,7 +200,7 @@ int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha,
|
|||||||
int ok = 0;
|
int ok = 0;
|
||||||
png_uint_32 width, height, y;
|
png_uint_32 width, height, y;
|
||||||
int stride;
|
int stride;
|
||||||
volatile uint8_t* rgb = NULL;
|
uint8_t* volatile rgb = NULL;
|
||||||
|
|
||||||
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
|
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
|
||||||
if (png == NULL) {
|
if (png == NULL) {
|
||||||
@ -271,8 +271,8 @@ int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha,
|
|||||||
pic->width = width;
|
pic->width = width;
|
||||||
pic->height = height;
|
pic->height = height;
|
||||||
pic->use_argb = 1;
|
pic->use_argb = 1;
|
||||||
ok = has_alpha ? WebPPictureImportRGBA(pic, (const uint8_t*)rgb, stride)
|
ok = has_alpha ? WebPPictureImportRGBA(pic, rgb, stride)
|
||||||
: WebPPictureImportRGB(pic, (const uint8_t*)rgb, stride);
|
: WebPPictureImportRGB(pic, rgb, stride);
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
goto Error;
|
goto Error;
|
||||||
@ -283,7 +283,7 @@ int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha,
|
|||||||
png_destroy_read_struct((png_structpp)&png,
|
png_destroy_read_struct((png_structpp)&png,
|
||||||
(png_infopp)&info, (png_infopp)&end_info);
|
(png_infopp)&info, (png_infopp)&end_info);
|
||||||
}
|
}
|
||||||
free((void*)rgb);
|
free(rgb);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
#else // !WEBP_HAVE_PNG
|
#else // !WEBP_HAVE_PNG
|
||||||
|
Loading…
Reference in New Issue
Block a user