Skip to content

Mime package does not recognize 3gp4 and 3gp2 magic numbers #2131

@Xentraxx

Description

@Xentraxx

A user reported the following issue: Xentraxx/GooglePhotosTakeoutHelper#60

I ran some tests and noticed that
[0x00, 0x00, 0x00, 0x14, 0x66, 0x74, 0x79, 0x70, 0x33, 0x67, 0x70, 0x34] (magic number for 3gp4) is not being detected as 3gp.

[0x00, 0x00, 0x00, 0x14, 0x66, 0x74, 0x79, 0x70, 0x33, 0x67, 0x70, 0x32] (magic number for 3gp2) is not being detected as 3gp.

In both cases, the mime package incorrectly returns "video/mp4".

However,
[0x00, 0x00, 0x00, 0x14, 0x66, 0x74, 0x79, 0x70, 0x33, 0x67, 0x70, 0x35] (magic number for 3gp5) is being detected as 3gp (returns "video/3gpp").

The last 3 bytes are the brand identifiers.

So to summarize, the mime package doesn't correctly return the 3gp mime type for 3gp4 and 3gp2 files. Only 3gp5 is being detected correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions