mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/bink: Check return value of av_add_index_entry()
Fixes null pointer dereference Fixes: cdbf15cbd0a27cee958dd0b8800e452e-signal_sigsegv_737991_2083_cov_317652874_LBSTART.BIK Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
6742614c23
commit
c57fc97e95
@ -81,6 +81,7 @@ static int read_header(AVFormatContext *s)
|
|||||||
uint32_t pos, next_pos;
|
uint32_t pos, next_pos;
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
int keyframe;
|
int keyframe;
|
||||||
|
int ret;
|
||||||
|
|
||||||
vst = avformat_new_stream(s, NULL);
|
vst = avformat_new_stream(s, NULL);
|
||||||
if (!vst)
|
if (!vst)
|
||||||
@ -184,8 +185,9 @@ static int read_header(AVFormatContext *s)
|
|||||||
av_log(s, AV_LOG_ERROR, "invalid frame index table\n");
|
av_log(s, AV_LOG_ERROR, "invalid frame index table\n");
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
}
|
||||||
av_add_index_entry(vst, pos, i, next_pos - pos, 0,
|
if ((ret = av_add_index_entry(vst, pos, i, next_pos - pos, 0,
|
||||||
keyframe ? AVINDEX_KEYFRAME : 0);
|
keyframe ? AVINDEX_KEYFRAME : 0)) < 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);
|
avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user