From d4751d8c630983e6343c3100debb5de80be50ac3 Mon Sep 17 00:00:00 2001 From: Nuo Mi Date: Sun, 29 Nov 2020 23:30:10 +0800 Subject: avcodec/hevcdec: dynamic allocate sList and HEVClcList following comandline will crash the ffmpeg ffmpeg -threads 17 -thread_type slice -i WPP_A_ericsson_MAIN_2.bit out.yuv -y the HEVCContext->sList size is MAX_NB_THREADS(16), any > 16 thread number will crash the application Signed-off-by: Anton Khirnov --- libavcodec/hevcdec.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libavcodec/hevcdec.h') diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index 39c5c7f89f..c0a138e97a 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -42,7 +42,6 @@ #include "thread.h" #include "videodsp.h" -#define MAX_NB_THREADS 16 #define SHIFT_CTB_WPP 2 //TODO: check if this is really the maximum @@ -468,9 +467,9 @@ typedef struct HEVCContext { const AVClass *c; // needed by private avoptions AVCodecContext *avctx; - struct HEVCContext *sList[MAX_NB_THREADS]; + struct HEVCContext **sList; - HEVCLocalContext *HEVClcList[MAX_NB_THREADS]; + HEVCLocalContext **HEVClcList; HEVCLocalContext *HEVClc; uint8_t threads_type; -- cgit v1.2.3