Browse Source

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 d85aa76115)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Conflicts:

	libavcodec/hevc.c
tags/n2.4.12
Michael Niedermayer 10 years ago
parent
commit
02764f12a6
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      libavcodec/hevc.c

+ 1
- 3
libavcodec/hevc.c View File

@@ -2413,11 +2413,9 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
int startheader, cmpt = 0;
int i, j, res = 0;

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));


Loading…
Cancel
Save