aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/cafdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-22 23:13:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-11-29 16:10:56 +0100
commit9dc3301745d8271ae3ba0f1b998d8e6a0aa01bc1 (patch)
tree56c18e24e4036f99e7fb187f2ac139d3b32fbcc7 /libavformat/cafdec.c
parenteb46939e3ab3e0e4df69486b1a037bffc50493bd (diff)
downloadffmpeg-9dc3301745d8271ae3ba0f1b998d8e6a0aa01bc1.tar.gz
avformat/cafdec: Check the return code from av_add_index_entry()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r--libavformat/cafdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index c1a9838b06..c188aad20f 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -192,6 +192,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);
@@ -207,7 +208,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);
}