Files
ffmpeg/libavfilter
Andreas Rheinhardt 2bcec40cce avfilter/vf_nnedi: Fix segfault when prescreening is disabled
Since c737f6edce prescreening is
nevertheless run because of a wrong check: "if (s->prescreen > 0)".
s->prescreen is an array of two function pointers that is contained in
the context and comparing it with 0 (i.e. NULL) is actually undefined
behaviour, because NULL and s->prescreen do not point to the same
object (NULL after all never points to any object). Nevertheless both
Clang as well as GCC compile this to code that treat s->prescreen > 0 as
true, leading to segfaults, because the code then tries to access the
-1th member of an array.

This commit fixes the check as well as another such check a few lines
below.

(Found via compiler warnings enabled by -pedantic:
"ordered comparison between pointer and zero is an extension".)

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-24 22:37:55 +01:00
..
2020-02-14 09:59:27 +01:00
2021-01-01 15:25:48 +01:00
2021-01-01 15:25:48 +01:00
2019-12-10 16:09:14 +01:00
2021-01-16 14:08:59 +01:00
2020-03-17 22:46:36 +01:00
2021-01-17 12:06:01 +01:00
2021-01-17 12:06:01 +01:00
2021-01-16 14:08:59 +01:00
2020-02-14 21:49:47 +01:00
2020-02-04 18:28:04 +01:00
2021-01-16 14:08:59 +01:00
2020-02-29 22:31:01 +01:00
2020-03-17 22:46:36 +01:00
2020-03-17 22:46:36 +01:00
2021-01-01 15:25:48 +01:00
2020-03-17 22:46:36 +01:00
2020-02-04 18:28:04 +01:00
2020-05-23 15:52:27 +02:00
2020-03-17 22:46:36 +01:00