aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-17 23:44:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-17 23:47:05 +0100
commitc57fc97e956a52edc94a38ff0ecd3058b44c15b7 (patch)
tree4d9ffd547dab898505fcf30bcde044f72b087c9d
parent6742614c231b5e0ad2615c40afd1b71ac90d466b (diff)
downloadffmpeg-c57fc97e956a52edc94a38ff0ecd3058b44c15b7.tar.gz
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>
-rw-r--r--libavformat/bink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 94990a2479..ec9257bca2 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -81,6 +81,7 @@ static int read_header(AVFormatContext *s)
uint32_t pos, next_pos;
uint16_t flags;
int keyframe;
+ int ret;
vst = avformat_new_stream(s, NULL);
if (!vst)
@@ -184,8 +185,9 @@ static int read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "invalid frame index table\n");
return AVERROR(EIO);
}
- av_add_index_entry(vst, pos, i, next_pos - pos, 0,
- keyframe ? AVINDEX_KEYFRAME : 0);
+ if ((ret = av_add_index_entry(vst, pos, i, next_pos - pos, 0,
+ keyframe ? AVINDEX_KEYFRAME : 0)) < 0)
+ return ret;
}
avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);