Travis Shirk avatar Travis Shirk committed 68ff389 Merge

merged

Comments (0)

Files changed (1)

src/eyed3/id3/frames.py

         # Owner identifier <text string> $00
         # Identifier       up to 64 bytes binary data>
         super(UniqueFileIDFrame, self).parse(data, frame_header)
-        (self.owner_id, self.uniq_id) = self.data.split("\x00", 1)
+        split_data = self.data.split('\x00', 1)
+        if len(split_data) == 2:
+            (self.owner_id, self.uniq_id) = split_data
+        else:
+            self.owner_id, self.uniq_id = b"", split_data[0]
         log.debug("UFID owner_id: %s" % self.owner_id)
         log.debug("UFID id: %s" % self.uniq_id)
         if len(self.owner_id) == 0:
             dummy_owner_id = "http://www.id3.org/dummy/ufid.html"
-            log.warning("Invalid UFID, owner_id is empty. Setting to '%s'" %
-                        dummy_owner_id)
             self.owner_id = dummy_owner_id
+            core.parseError(FrameException("Invalid UFID, owner_id is empty. "
+                                           "Setting to '%s'" % dummy_owner_id))
         elif 0 <= len(self.uniq_id) > 64:
-            log.warning("Invalid UFID, ID is empty or too long: %s" %
-                        self.uniq_id)
+            core.parseError(FrameException("Invalid UFID, ID is empty or too "
+                                           "long: %s" % self.uniq_id))
 
     def render(self):
         self.data = self.owner_id + "\x00" + self.uniq_id
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.