]> git.sesse.net Git - ffmpeg/commit
dnn_backend_native_layer_avgpool: Fix invalid assignment, use av_assert
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 21 Aug 2020 11:47:27 +0000 (13:47 +0200)
committerGuo, Yejun <yejun.guo@intel.com>
Fri, 21 Aug 2020 14:12:39 +0000 (22:12 +0800)
commit128e6df1cd79076e3d5f51bbc88607b3d1c62689
treea2df37fcf6cb1c5455fa45f582bdd95552a5898e
parentd2206f0c5b77306ac6f6310fd0f02a412a6ebfe9
dnn_backend_native_layer_avgpool: Fix invalid assignment, use av_assert

dnn_execute_layer_avg_pool() contains the following line:

assert(avgpool_params->padding_method = VALID);

This statement contains an assignment where obviously a comparison was
intended. Furthermore, *avgpool_params is const, so that the attempted
assignment leads to a compilation failure if asserts are enabled
(i.e. if DEBUG is defined which leads libavutil/internal.h to not define
NDEBUG). Moreover, the enumeration constant VALID actually has the value 0,
so that the assert would be triggered if a compiler compiles this with
asserts enabled. Finally, the statement uses assert() directly instead
of av_assert*().

All these errors have been fixed.

Thanks to ubitux for providing a FATE-box [1] where DEBUG is defined.

[1]: http://fate.ffmpeg.org/history.cgi?slot=x86_64-archlinux-gcc-ddebug

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
libavfilter/dnn/dnn_backend_native_layer_avgpool.c