eDebug("[PNG] Error processing");
return 0;
}
-
+
+ if (width * height > 1000000) // 1000x1000 or equiv.
+ {
+ eDebug("[png_load] image size is %d x %d, which is \"too large\".", width, height);
+ png_read_end(png_ptr, info_ptr);
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
+ fclose(fh);
+ return 0;
+ }
+
pic_buffer = new unsigned char[width * height * 3];
*x=width;
*y=height;
double aspect_ratio;
switch(aspect)
{
- case 1: aspect_ratio = 1.777 / ((double)720/576); break; //16:9
- case 2: aspect_ratio = 1.600 / ((double)720/576); break; //16:10
- //case 3: aspect_ratio = 1.250 / ((double)720/576); break; //5:4
- default: aspect_ratio = 1.333 / ((double)720/576); //4:3
+ case 1: aspect_ratio = 1.778 / ((double)702/576); break; //16:9
+ case 2: aspect_ratio = 1.600 / ((double)702/576); break; //16:10
+ //case 3: aspect_ratio = 1.250 / ((double)702/576); break; //5:4
+ default: aspect_ratio = 1.333 / ((double)702/576); //4:3
}
if((aspect_ratio * oy * w / ox) <= h)