diff mbox series

[FFmpeg-devel] avfilter/vf_vpp_qsv: Don't overrun stack array

Message ID AM7PR03MB6660B03E0C46D15100F92A118FF19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit cc6f6a1eefcfbfcae30e558a7d77f75284ff2c2f
Headers show
Series [FFmpeg-devel] avfilter/vf_vpp_qsv: Don't overrun stack array | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 4, 2021, 12:27 a.m. UTC
8b83dad82512a6948b63408f964463b063ad24c9 added another potentially used
video enhancement filter without increasing a define for the number of
such options which is used as the size of stack array. This can lead to
a buffer overrun if all filters are used simultaneously. So increase
said number.

Fixes Coverity ticket #1489775.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_vpp_qsv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Fei Wang Aug. 4, 2021, 1:39 a.m. UTC | #1
On Wed, 2021-08-04 at 02:27 +0200, Andreas Rheinhardt wrote:
> 8b83dad82512a6948b63408f964463b063ad24c9 added another potentially
> used
> video enhancement filter without increasing a define for the number
> of
> such options which is used as the size of stack array. This can lead
> to
> a buffer overrun if all filters are used simultaneously. So increase
> said number.
> 
> Fixes Coverity ticket #1489775.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavfilter/vf_vpp_qsv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
> index f2309ed9d9..70bd5310c3 100644
> --- a/libavfilter/vf_vpp_qsv.c
> +++ b/libavfilter/vf_vpp_qsv.c
> @@ -42,7 +42,7 @@
>  #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM |
> AV_OPT_FLAG_FILTERING_PARAM)
>  
>  /* number of video enhancement filters */
> -#define ENH_FILTERS_COUNT (7)
> +#define ENH_FILTERS_COUNT (8)

LGTM, Thanks Andreas.

>  #define QSV_HAVE_ROTATION       QSV_VERSION_ATLEAST(1, 17)
>  #define QSV_HAVE_MIRRORING      QSV_VERSION_ATLEAST(1, 19)
>  #define QSV_HAVE_SCALING_CONFIG QSV_VERSION_ATLEAST(1, 19)
diff mbox series

Patch

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index f2309ed9d9..70bd5310c3 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -42,7 +42,7 @@ 
 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
 
 /* number of video enhancement filters */
-#define ENH_FILTERS_COUNT (7)
+#define ENH_FILTERS_COUNT (8)
 #define QSV_HAVE_ROTATION       QSV_VERSION_ATLEAST(1, 17)
 #define QSV_HAVE_MIRRORING      QSV_VERSION_ATLEAST(1, 19)
 #define QSV_HAVE_SCALING_CONFIG QSV_VERSION_ATLEAST(1, 19)