mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
gxf: avoid null ptr deref without streams.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c871244306
commit
5aedee4fac
@ -270,15 +270,16 @@ static void gxf_track_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si
|
|||||||
*/
|
*/
|
||||||
static void gxf_read_index(AVFormatContext *s, int pkt_len) {
|
static void gxf_read_index(AVFormatContext *s, int pkt_len) {
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
AVStream *st = s->streams[0];
|
AVStream *st;
|
||||||
uint32_t fields_per_map = avio_rl32(pb);
|
uint32_t fields_per_map = avio_rl32(pb);
|
||||||
uint32_t map_cnt = avio_rl32(pb);
|
uint32_t map_cnt = avio_rl32(pb);
|
||||||
int i;
|
int i;
|
||||||
pkt_len -= 8;
|
pkt_len -= 8;
|
||||||
if (s->flags & AVFMT_FLAG_IGNIDX) {
|
if ((s->flags & AVFMT_FLAG_IGNIDX) || !s->streams) {
|
||||||
avio_skip(pb, pkt_len);
|
avio_skip(pb, pkt_len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
st = s->streams[0];
|
||||||
if (map_cnt > 1000) {
|
if (map_cnt > 1000) {
|
||||||
av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt);
|
av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt);
|
||||||
map_cnt = 1000;
|
map_cnt = 1000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user