aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-27 23:33:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-20 10:59:27 +0100
commitc84ec8d5c93887c2a97c3da514848f5fbb5ba3e6 (patch)
tree8f2a26bb4af8ba3c96f6b408c3767caf38031d82
parent4916aa2383153745d2ca54c7f8ea6cbc75f1c00e (diff)
downloadffmpeg-c84ec8d5c93887c2a97c3da514848f5fbb5ba3e6.tar.gz
avcodec/hevc: allocate entries unconditionally
Fixes out of array access Fixes: 08664a2a7921ef48172f26495c7455be/asan_heap-oob_23036c6_3301_523388ef84285a0270caf67a43247b59.bit Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d85aa76115214183e7e3b7d65e950da61474959a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hevc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index a2c602a586..66ebf3d890 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2430,11 +2430,9 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
return AVERROR(ENOMEM);
}
+ ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
if (!s->sList[1]) {
- ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
-
-
for (i = 1; i < s->threads_number; i++) {
s->sList[i] = av_malloc(sizeof(HEVCContext));
memcpy(s->sList[i], s, sizeof(HEVCContext));