Commits

Adrian Sampson committed 244db77

warning about _unpack_asf_image

Comments (0)

Files changed (1)

beets/mediafile.py

 # Image coding for ASF/WMA.
 
 def _unpack_asf_image(data):
-    """Unpack image data from a WM/Picture tag.
+    """Unpack image data from a WM/Picture tag. Return a tuple
+    containing the MIME type, the raw image data, a type indicator, and
+    the image's description.
+
+    This function is treated as "untrusted" and could throw all manner
+    of exceptions (out-of-bounds, etc.). We should clean this up
+    sometime so that the failure modes are well-defined.
     """
-    (type, size) = struct.unpack_from("<bi", data)
+    type, size = struct.unpack_from("<bi", data)
     pos = 5
     mime = ""
     while data[pos:pos+2] != "\x00\x00":