mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-07 15:22:57 +00:00
avformat/cafdec: Check the return code from av_add_index_entry()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9dc3301745
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c15e4b5a20
commit
1121985dbd
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user