mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
warning about _unpack_asf_image
This commit is contained in:
parent
70492ab67e
commit
ce7a57d57a
1 changed files with 8 additions and 2 deletions
|
|
@ -148,9 +148,15 @@ def _safe_cast(out_type, val):
|
|||
# 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":
|
||||
|
|
|
|||
Loading…
Reference in a new issue