Skip to content

possible bug in m4a parsing #482

@milesegan

Description

@milesegan

Reproducer

I tried this code:

fn main() {
    // the error seems to occur with strict or relaxed parsing mode
    let parsing_options = ParseOptions::new().parsing_mode(ParsingMode::Relaxed);
    let path = Path::new("sample.m4a");
    let file = Probe::open(&path)
        .expect("can't probe")
        .options(parsing_options)
        .read()
        .expect("can't read");
    let tag = file.primary_tag().expect("no tag");
    let properties = file.properties();
    println!("{:?}", tag.artist());
    println!("{:?}", tag.year());
}

Summary

When trying to read the file I get this panic:

no read: BadAtom("\"covr\" atom has an unknown type")
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::expect
   4: rust_lib_spinner::api::tagging::read_tag

Expected behavior

I don't doubt that there is a bad atom here. Could it be skipped in relaxed mode?

ffprobe output:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x140e06d30] Unknown cover type: 0x15.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.m4a':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    album_artist    : BADBADNOTGOOD
    disc            : 1/24576
    track           : 1/24576
    artist          : BADBADNOTGOOD
    album           : III
    date            : 2014
    title           : Triangle
    encoder         : Lavf55.14.102
    genre           : Hip Hop
  Duration: 00:03:47.00, start: 0.000000, bitrate: 514 kb/s
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 511 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]

Assets

sample.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions