[SPIP] ~maj v3.2.9-->v3.2.11
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.graphic.png.php
index a9827f2..018062c 100644 (file)
@@ -14,6 +14,9 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+       exit;
+}
 
 class getid3_png extends getid3_handler
 {
@@ -593,23 +596,18 @@ class getid3_png extends getid3_handler
                switch ($color_type) {
                        case 0: // Each pixel is a grayscale sample.
                                return $bit_depth;
-                               break;
 
                        case 2: // Each pixel is an R,G,B triple
                                return 3 * $bit_depth;
-                               break;
 
                        case 3: // Each pixel is a palette index; a PLTE chunk must appear.
                                return $bit_depth;
-                               break;
 
                        case 4: // Each pixel is a grayscale sample, followed by an alpha sample.
                                return 2 * $bit_depth;
-                               break;
 
                        case 6: // Each pixel is an R,G,B triple, followed by an alpha sample.
                                return 4 * $bit_depth;
-                               break;
                }
                return false;
        }