Opened 4 years ago

Closed 4 years ago

#8508 closed defect (fixed)

mp4 - STSC entry 1 is invalid

Reported by: Jon Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Some mp4 audio files are not readable. Example attached. If I comment out the invalid data error return in mov_read_trak() in libavformat/mov.c, the attached file plays without error. Both VLC and win 10 builtin player can play the attached. I tested with with ffmpeg versions head, 4.2 and 3.6. The attached file errors out on all 3 versions tested.

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 589576b..95d57e3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4224,7 +4224,7 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     if (sc->stsc_count && sc->stsc_data[ sc->stsc_count - 1 ].first > sc->chunk_count) {
         av_log(c->fc, AV_LOG_ERROR, "stream %d, contradictionary STSC and STCO\n",
                st->index);
-        return AVERROR_INVALIDDATA;
+//        return AVERROR_INVALIDDATA;
     }
 
     fix_timescale(c, sc);

How to reproduce:

./ffprobe ../STSC_entry_1_is_invalid_13_Glass.m4a 
ffprobe version n4.2.2-1-g19bfd72126 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --disable-shared --enable-static
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56431e165d80] STSC entry 1 is invalid (first=43 count=0 id=1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56431e165d80] stream 0, contradictionary STSC and STCO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x56431e165d80] error reading header
../STSC_entry_1_is_invalid_13_Glass.m4a: Invalid data found when processing input

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (1)

STSC_entry_1_is_invalid_13_Glass.m4a (1.7 MB ) - added by Jon 4 years ago.
mp4 audio file that errors in header

Download all attachments as: .zip

Change History (3)

by Jon, 4 years ago

mp4 audio file that errors in header

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedavformat
Keywords: mov regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Regression since 9e67447a4ffacf28af8bace33faf3ea432ddc43e, see also ticket #7165.

comment:2 by Carl Eugen Hoyos, 4 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.