Skip to content

Video metadata using non-UTF8 encoding causes crash #423

@transplier

Description

@transplier

test.zip
Sigal crashes if a video has non-UTF8 text metadata present. I attach a sample file, which has a non-UTF8 string in the handler_name MP4 metadata attribute. This causes a problem as Sigal runs ffmpeg -i on the video, then attempts to interpret the output as UTF8. Since ffmpeg -i also dumps out metadata, this fails.

This is the site of the crash:

stderr = res.stderr.decode('utf8')

I suspect telling Python to ignore invalid UTF8 sequences will be enough to fulfill the code's purpose:

stderr = res.stderr.decode('utf8', 'ignore')

With the above change, my gallery builds fine. I'm unsure what broader behavior Sigal exhibits with non-UTF8 text, as none of the metadata I have ends up in the generated HTML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions