metadata: Reduce stack usage in nfo parsing
64KB is a bit much for a stack buffer. Use dynamic allocation instead.
This commit is contained in:
@ -730,7 +730,7 @@ image_downsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height)
|
||||
{
|
||||
vcol = get_pix(psrc, ((int32_t)rx)-half_square_width+i,
|
||||
((int32_t)ry)-half_square_height+j);
|
||||
|
||||
|
||||
if(((j == 0) || (j == (half_square_height<<1)-1)) &&
|
||||
((i == 0) || (i == (half_square_width<<1)-1)))
|
||||
{
|
||||
@ -762,12 +762,12 @@ image_downsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
red /= width_scale*height_scale;
|
||||
green /= width_scale*height_scale;
|
||||
blue /= width_scale*height_scale;
|
||||
alpha /= width_scale*height_scale;
|
||||
|
||||
|
||||
/* on sature les valeurs */
|
||||
red = (red > 255.0)? 255.0 : ((red < 0.0)? 0.0:red );
|
||||
green = (green > 255.0)? 255.0 : ((green < 0.0)? 0.0:green);
|
||||
@ -857,7 +857,7 @@ image_save_to_jpeg_file(image_s * pimage, char * path)
|
||||
buf = image_save_to_jpeg_buf(pimage, &size);
|
||||
if( !buf )
|
||||
return NULL;
|
||||
dst_file = fopen(path, "w");
|
||||
dst_file = fopen(path, "w");
|
||||
if( !dst_file )
|
||||
{
|
||||
free(buf);
|
||||
|
Reference in New Issue
Block a user