[SPIP] ~maj v3.2.9-->v3.2.11
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.audio.voc.php
index 3803d8a..f765719 100644 (file)
@@ -1,11 +1,11 @@
 <?php
+
 /////////////////////////////////////////////////////////////////
 /// getID3() by James Heinrich <info@getid3.org>               //
-//  available at http://getid3.sourceforge.net                 //
-//            or http://www.getid3.org                         //
-//          also https://github.com/JamesHeinrich/getID3       //
-/////////////////////////////////////////////////////////////////
-// See readme.txt for more details                             //
+//  available at https://github.com/JamesHeinrich/getID3       //
+//            or https://www.getid3.org                        //
+//            or http://getid3.sourceforge.net                 //
+//  see readme.txt for more details                            //
 /////////////////////////////////////////////////////////////////
 //                                                             //
 // module.audio.voc.php                                        //
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+       exit;
+}
 
 class getid3_voc extends getid3_handler
 {
-
+       /**
+        * @return bool
+        */
        public function Analyze() {
                $info = &$this->getid3->info;
 
@@ -59,7 +64,7 @@ class getid3_voc extends getid3_handler
 
                        $BlockOffset    = $this->ftell();
                        $BlockData      = $this->fread(4);
-                       $BlockType      = ord($BlockData{0});
+                       $BlockType      = ord($BlockData[0]);
                        $BlockSize      = getid3_lib::LittleEndian2Int(substr($BlockData, 1, 3));
                        $ThisBlock      = array();
 
@@ -164,6 +169,11 @@ class getid3_voc extends getid3_handler
                return true;
        }
 
+       /**
+        * @param int $index
+        *
+        * @return string
+        */
        public function VOCcompressionTypeLookup($index) {
                static $VOCcompressionTypeLookup = array(
                        0 => '8-bit',
@@ -174,6 +184,11 @@ class getid3_voc extends getid3_handler
                return (isset($VOCcompressionTypeLookup[$index]) ? $VOCcompressionTypeLookup[$index] : 'Multi DAC ('.($index - 3).') channels');
        }
 
+       /**
+        * @param int $index
+        *
+        * @return string|false
+        */
        public function VOCwFormatLookup($index) {
                static $VOCwFormatLookup = array(
                        0x0000 => '8-bit unsigned PCM',
@@ -188,6 +203,11 @@ class getid3_voc extends getid3_handler
                return (isset($VOCwFormatLookup[$index]) ? $VOCwFormatLookup[$index] : false);
        }
 
+       /**
+        * @param int $index
+        *
+        * @return int|false
+        */
        public function VOCwFormatActualBitsPerSampleLookup($index) {
                static $VOCwFormatLookup = array(
                        0x0000 =>  8,