Commits

Travis Shirk committed 45de84d

statistics, don't choke on files that look like mp3 but contain no valid mp3
data

  • Participants
  • Parent commits c044dd0
  • Branches stable

Comments (0)

Files changed (1)

File src/eyed3/plugins/statistics.py

         if not audio_file:
             return None
 
+        if not audio_file.info:
+            # Detected as an audio file but not real audio data found.
+            return [(-90, "No audio data found")]
+
         is_vbr, bitrate = audio_file.info.bit_rate
         for threshold, score in BITRATE_DEDUCTIONS:
             if bitrate < threshold: