diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-22 23:13:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-09 22:02:19 +0200 |
commit | 4622b9359a4009f32878d1247cac2249ff2b0d3c (patch) | |
tree | 21e521d6ea7205380b65cd7d385e1c4080305a2b | |
parent | b25aae7253cea8ce25f73e37a765a3a74c9a3dd7 (diff) | |
download | ffmpeg-4622b9359a4009f32878d1247cac2249ff2b0d3c.tar.gz |
avformat/cafdec: Check the return code from av_add_index_entry()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9dc3301745d8271ae3ba0f1b998d8e6a0aa01bc1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/cafdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 8c31ded164..95b99ebbe2 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -186,6 +186,7 @@ static int read_pakt_chunk(AVFormatContext *s, int64_t size) CafContext *caf = s->priv_data; int64_t pos = 0, ccount, num_packets; int i; + int ret; ccount = avio_tell(pb); @@ -201,7 +202,9 @@ static int read_pakt_chunk(AVFormatContext *s, int64_t size) for (i = 0; i < num_packets; i++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; - av_add_index_entry(s->streams[0], pos, st->duration, 0, 0, AVINDEX_KEYFRAME); + ret = av_add_index_entry(s->streams[0], pos, st->duration, 0, 0, AVINDEX_KEYFRAME); + if (ret < 0) + return ret; pos += caf->bytes_per_packet ? caf->bytes_per_packet : ff_mp4_read_descr_len(pb); st->duration += caf->frames_per_packet ? caf->frames_per_packet : ff_mp4_read_descr_len(pb); } |