diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 8ee2abc13c..f7ede4db6b 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -2450,11 +2450,9 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal) 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));