patch by Pieter Grimmerink: use ext3 largefile option only for disks > 4G
[enigma2.git] / lib / gdi / picload.cpp
index e3cdc035606e5aaa39405fa03ac2691ae3a906e6..f8949cff448ad3abf0c68bc13671a31267929058 100644 (file)
@@ -393,7 +393,16 @@ static int png_load(const char *filename,  int *x, int *y)
                eDebug("[PNG] Error processing");
                return 0;
        }
                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;
        pic_buffer = new unsigned char[width * height * 3];
        *x=width;
        *y=height;
@@ -642,10 +651,10 @@ int loadPic(ePtr<gPixmap> &result, std::string filename, int w, int h, int aspec
                double aspect_ratio;
                switch(aspect)
                {
                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)
                }
 
                if((aspect_ratio * oy * w / ox) <= h)