diff options
author | tiejun.peng <tiejun.peng@foxmail.com> | 2017-12-09 00:28:41 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-12-09 23:12:30 +0100 |
commit | ab651587a715dc59775650a4c8af3cddcdfd26f8 (patch) | |
tree | c3170e6be6fe860cb6def757b9c3b142253794fe /libavformat/mov.c | |
parent | b38f222165f97af19f5bfc2c3e9217b5d1b25cfb (diff) | |
download | ffmpeg-ab651587a715dc59775650a4c8af3cddcdfd26f8.tar.gz |
lavf/mov: add some useful warning log of eof
Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 0b3e673c06..48ec45254f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1991,8 +1991,10 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->chunk_count = i; - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STCO atom\n"); return AVERROR_EOF; + } return 0; } @@ -2522,8 +2524,10 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) sc->stsd_count++; } - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STSD atom\n"); return AVERROR_EOF; + } return 0; } @@ -2624,8 +2628,10 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->stsc_count = i; - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STSC atom\n"); return AVERROR_EOF; + } return 0; } @@ -2676,8 +2682,10 @@ static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->stps_count = i; - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STPS atom\n"); return AVERROR_EOF; + } return 0; } @@ -2723,8 +2731,10 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->keyframe_count = i; - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STSS atom\n"); return AVERROR_EOF; + } return 0; } @@ -2808,8 +2818,10 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_free(buf); - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STSZ atom\n"); return AVERROR_EOF; + } return 0; } @@ -2870,8 +2882,10 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->duration_for_fps += duration; sc->nb_frames_for_fps += total_sample_count; - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STTS atom\n"); return AVERROR_EOF; + } st->nb_frames= total_sample_count; if (duration) @@ -2947,8 +2961,10 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->ctts_count = ctts_count; - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted CTTS atom\n"); return AVERROR_EOF; + } av_log(c->fc, AV_LOG_TRACE, "dts shift %d\n", sc->dts_shift); @@ -2994,7 +3010,12 @@ static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->rap_group_count = i; - return pb->eof_reached ? AVERROR_EOF : 0; + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted SBGP atom\n"); + return AVERROR_EOF; + } + + return 0; } /** @@ -4743,8 +4764,10 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom) fix_frag_index_entries(&c->frag_index, next_frag_index, frag->track_id, entries); - if (pb->eof_reached) + if (pb->eof_reached) { + av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted TRUN atom\n"); return AVERROR_EOF; + } frag->implicit_offset = offset; |