patch by Pieter Grimmerink: use ext3 largefile option only for disks > 4G
[enigma2.git] / lib / gdi / picload.cpp
index e3cdc03..f8949cf 100644 (file)
@@ -393,7 +393,16 @@ static int png_load(const char *filename,  int *x, int *y)
                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;
@@ -642,10 +651,10 @@ int loadPic(ePtr<gPixmap> &result, std::string filename, int w, int h, int aspec
                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)