Opened 8 weeks ago
Last modified 8 weeks ago
#11196 new defect
ffmpeg is unable to identify/open mpeg 2/3 files with only one frame
Reported by: | Greisberger Christophe | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
% ffmpeg -i input.21 output.wav [mp3 @ 000001A7C88A2C00] Format mp3 detected only with low score of 1, misdetection possible! [mp3 @ 000001A7C88A2C00] Invalid frame size (768): Could not seek to 768. [in#0 @ 000001A7C887E040] Error opening input: Invalid argument Error opening input file input.21. Error opening input files: Invalid argument
I tracked the problem in libavformat/mp3_dec.c
here:
mp3_read_header(AVFormatContext *s) { ... ffio_ensure_seekback(s->pb, i + 1024 + frame_size + 4); ret = check(s->pb, off + i + frame_size, &header2); if (ret >= 0 && (header & MP3_MASK) == (header2 & MP3_MASK)) { break; } else if (ret == CHECK_SEEK_FAILED) { av_log(s, AV_LOG_ERROR, "Invalid frame size (%d): Could not seek to %"PRId64".\n", frame_size, off + i + frame_size); return AVERROR(EINVAL); }
It seeks to the end of the 1st (any unique) frame, then fails to read 4 bytes (of course).
With files with at least 2 frames, it works
Attachments (4)
Note:
See TracTickets
for help on using tickets.
MPEG 2 file (1 frame)