summaryrefslogtreecommitdiff
path: root/libavfilter/vf_signature.c
Commit message (Collapse)AuthorAge
* avfilter/vf_signature: Avoid cast from function pointer to void*Andreas Rheinhardt2020-08-26
| | | | | | | | | | | | | | | | | | | | | | | | The signature filter uses qsort, but its compare function doesn't have the signature required of such a function; therefore it casts the function pointer to void. Yet this is wrong: C90 only guarantees that one can convert a pointer to any incomplete type or object type to void* and back with the result comparing equal to the original which makes pointers to void generic pointers to incomplete or object type. Yet C90 lacks a generic function pointer type. C99 additionally guarantees that a pointer to a function of one type may be converted to a pointer to a function of another type with the result and the original comparing equal when converting back. This makes any function pointer type a generic function pointer type. Yet even this does not make pointers to void generic function pointers. Both GCC and Clang emit warnings for this when in pedantic mode. This commit fixes this by modifying the compare function to comply with the expected signature. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_signature: Fix leak of string upon errorAndreas Rheinhardt2020-08-26
| | | | | | | | | If an error happens between allocating a string intended to be used as an inpad's name and attaching it to its input pad, the string leaks. Fix this by inserting the inpad directly after allocating its string. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_signature: Fix leak of inpads' namesAndreas Rheinhardt2020-08-26
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec, avfilter, avformat: Remove redundant avpriv_align_put_bitsAndreas Rheinhardt2020-08-01
| | | | | | | | flush_put_bits() already fills the bitstream with zeroes, so it is unnecessary to align the bitstream before. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_signature: use av_strlcpy()Michael Niedermayer2018-04-01
| | | | | | | Fixes: out of array access Found-by: Kira <kira_cxy@foxmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_signature: fix memory leaks in error casesTimo Rothenpieler2017-06-13
| | | | Fixes CIDs 1403234 and 1403235
* avfilter/vf_signature: Replace uncommon spelling of seperateMichael Niedermayer2017-03-26
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* add signature filter for MPEG7 video signatureGerion Entrup2017-03-21
This filter does not implement all features of MPEG7. Missing features: - compression of signature files - work only on (cropped) parts of the video Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>