aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/avdevice.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-01-24 21:56:36 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-01-24 22:37:55 +0100
commit2bcec40ccee6a848db4034c4d096a44bf10db957 (patch)
tree3c71c1db3e436a4eeceaf131a995e6bd26793641 /libavdevice/avdevice.h
parent2687070d9b092d3a354a6963c65197054ddf7a75 (diff)
downloadffmpeg-2bcec40ccee6a848db4034c4d096a44bf10db957.tar.gz
avfilter/vf_nnedi: Fix segfault when prescreening is disabled
Since c737f6edcef74a64f4d0ebcefa970bd31266d512 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>
Diffstat (limited to 'libavdevice/avdevice.h')
0 files changed, 0 insertions, 0 deletions