summaryrefslogtreecommitdiff
path: root/cmdutils_opencl.c
Commit message (Collapse)AuthorAge
* cmdutils_opencl: fix resource_leak cid 1396852Steven Liu2017-01-13
| | | | | | | | | CID: 1396852 check the devices_list alloc status, and release the devices_list when alloc devices error Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* all: use FFDIFFSIGN to resolve possible undefined behavior in comparatorsGanesh Ajjanagadde2015-11-03
| | | | | | | | | | | | | | | | | | | FFDIFFSIGN was created explicitly for this purpose, since the common return a - b idiom is unsafe regarding overflow on signed integers. It optimizes to branchless code on common compilers. FFDIFFSIGN also has the subjective benefit of being easier to read due to lack of ternary operators. Tested with FATE. Things not covered by this are unsigned integers, for which overflows are well defined, and also places where overflow is clearly impossible, e.g an instance where the a - b was being done on 24 bit values. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* all: add const-correctness to qsort comparatorsGanesh Ajjanagadde2015-10-25
| | | | | | | This adds const-correctness when needed for the comparators. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* OpenCL: Avoid potential buffer overflow in cmdutils_opencl.cManeesh Gupta2015-04-28
| | | | | | | | The opt_opencl_bench function copied the device name using strcpy without checking if the source string was larger. This patch fixes this by replacing the strcpy with av_strlcpy, with the string copy size capped to the destination buffer size. Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cmdutils_opencl: Use av_malloc_array()Michael Niedermayer2014-07-01
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* ffmpeg: Use av_gettime_relative()Olivier Langlois2014-05-19
| | | | | | | | | Whenever av_gettime() is used to measure relative period of time, av_gettime_relative() is prefered as it guarantee monotonic time on supported platforms. Signed-off-by: Olivier Langlois <olivier@trillion01.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cmdutils & opencl: add -opencl_bench option to test and show available ↵Lenny Wang2013-12-09
OpenCL devices Reviewed-by: Wei Gao <highgod0401@gmail.com> Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>