Andreas Rheinhardt
bb2b5254f9
avfilter/vf_xfade: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:25 +02:00
Andreas Rheinhardt
46c1c6beb9
avfilter/vf_xmedian: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:25 +02:00
Andreas Rheinhardt
98e7992acf
avfilter/vf_yadif: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:25 +02:00
Andreas Rheinhardt
57f851a21d
avfilter/vf_zoompan: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:25 +02:00
Andreas Rheinhardt
57b1f82775
avfilter/vf_yaepblur: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:25 +02:00
Andreas Rheinhardt
77b72a0759
avfilter/vsrc_cellauto: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:25 +02:00
Andreas Rheinhardt
90daa728d8
avfilter/vsrc_gradients: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
9a62afc5fc
avfilter/vsrc_mandelbrot: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
84b04e610d
avfilter/vsrc_mptestsrc: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
b36514b9d9
avfilter/vsrc_sierpinski: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
a26efeb121
avfilter/vf_hsvkey: Use formats list instead of query function
...
In this case it also allows to avoid a runtime check to which filter
an AVFilterContext belongs to.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
253dc9bbc0
avfilter/vf_chromashift: Use formats list instead of query function
...
In this case it also allows to avoid a runtime check to which filter
an AVFilterContext belongs to.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
17e44e4d1f
avfilter/vf_chromakey: Use formats list instead of query function
...
In this case it also allows to avoid a runtime check to which filter
an AVFilterContext belongs to.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
a4722a4aa0
avfilter/vf_tonemap: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
5237a29d05
avfilter/vf_thumbnail_cuda: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
dc57da3b1a
avfilter/vf_pseudocolor: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
8d06c2e7eb
avfilter/vf_mcdeint: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
9e48552ec6
avfilter/vf_lensfun: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
a3cd5bb638
avfilter/vf_hqx: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
27d2af093e
avfilter/vf_framepack: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
0a8312f5a4
avfilter/vf_exposure: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
b779e3bc8c
avfilter/vf_derain: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
c355705ab1
avfilter/vf_curves: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
e6d233e362
avfilter/vf_cover_rect: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:24 +02:00
Andreas Rheinhardt
29ffdd7848
avfilter/vf_coreimage: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:58:09 +02:00
Andreas Rheinhardt
b02929b70c
avfilter/vf_colormatrix: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
f182e0c64f
avfilter/vf_colorlevels: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
5ee2bd6e8b
avfilter/vf_colorkey: Use formats list instead of query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
203889db8f
avfilter/vf_colorconstancy: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
be26348153
avfilter/vf_codecview: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
4317cea6ce
avfilter/vf_blackframe: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
bd17c4359e
avfilter/vf_avgblur: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
6d473dfa95
avfilter/vf_atadenoise: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
b42e66553d
avfilter/vf_amplify: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
0e42f12ec6
avfilter/af_agate: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
5c36cb2ebf
avfilter/af_afftfilt: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
54fd49f352
avfilter/af_volumedetect: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:04 +02:00
Andreas Rheinhardt
6b72e0be4f
avfilter/af_vibrato: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
c5610d5a06
avfilter/af_tremolo: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
53aa11a6f1
avfilter/af_superequalizer: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
e597b83e25
avfilter/af_speechnorm: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
9abb877362
avfilter/af_silenceremove: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
861aaebf7c
avfilter/af_silencedetect: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
174e7f8509
avfilter/af_sidechaincompress: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
88a92cb754
avfilter/af_rubberband: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
3f064c21cb
avfilter/af_flanger: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
efc9a5b4f9
avfilter/af_firequalizer: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
0c30dc0f9e
avfilter/af_mcompand: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
e74acd5771
avfilter/af_dynaudnorm: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
a4e9a7e40a
avfilter/af_drmeter: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
a731d0907f
avfilter/af_deesser: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
abd917d6eb
avfilter/af_dcshift: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
6cb9cf64d1
avfilter/af_crystalizer: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
e08dc59200
avfilter/af_compensationdelay: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
4bcb75ebae
avfilter/af_compand: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
3eeb78866a
avfilter/af_chorus: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
4f6bf3eee2
avfilter/af_axcorrelate: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
2329c33ce3
avfilter/af_atilt: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
b8f74ee57a
avfilter/af_atempo: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:03 +02:00
Andreas Rheinhardt
d1971efc99
avfilter/af_asupercut: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
8c35439a24
avfilter/af_asubboost: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
2f51b80f0f
avfilter/af_astats: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
6176aee16e
avfilter/af_asoftclip: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
55c7ee9e93
avfilter/af_apsyclip: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
8a588deb92
avfilter/af_aphaser: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
06ff6dad44
avfilter/af_anlmdn: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
d8a5b90a08
avfilter/af_amultiply: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
ade39d5b4f
avfilter/af_amix: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
d6bf86843d
avfilter/af_alimiter: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
b163ecc3db
avfilter/af_afwtdn: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
19511a273c
avfilter/af_afreqshift: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
d3bb91d303
avfilter/af_afftdn: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
ba90e306c2
avfilter/af_afade: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
8a4b76e9ee
avfilter/af_aexciter: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
53d41fd4f0
avfilter/af_aemphasis: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
920c2fc9b1
avfilter/af_aecho: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
5f39512dee
avfilter/af_aderivative: Use formats list instead of query function
...
In this case switching to .formats.samples even allows to avoid
the runtime check for which filter is currently used.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
b10b194761
avfilter/af_adenorm: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
20e3316584
avfilter/af_adelay: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
063af69db4
avfilter/af_adecorrelate: Store format in filter, remove query func
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
b4ab91b2b5
avfilter/af_adeclick: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
69729a15f2
avfilter/af_acrusher: Store format in filter, remove query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
f9c931cf1b
avfilter/af_crossover: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:02 +02:00
Andreas Rheinhardt
e61393d006
avfilter/af_contrast: Use formats list instead of query function
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 18:01:01 +02:00
Andreas Rheinhardt
b4f5201967
avfilter: Replace query_formats callback with union of list and callback
...
If one looks at the many query_formats callbacks in existence,
one will immediately recognize that there is one type of default
callback for video and a slightly different default callback for
audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);"
for video with a filter-specific pix_fmts list. For audio, it is
the same with a filter-specific sample_fmts list together with
ff_set_common_all_samplerates() and ff_set_common_all_channel_counts().
This commit allows to remove the boilerplate query_formats callbacks
by replacing said callback with a union consisting the old callback
and pointers for pixel and sample format arrays. For the not uncommon
case in which these lists only contain a single entry (besides the
sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also
added to the union to store them directly in the AVFilter,
thereby avoiding a relocation.
The state of said union will be contained in a new, dedicated AVFilter
field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t
in order to create a hole for this new field; this is no problem, as
the maximum of all the nb_inputs is four; for nb_outputs it is only
two).
The state's default value coincides with the earlier default of
query_formats being unset, namely that the filter accepts all formats
(and also sample rates and channel counts/layouts for audio)
provided that these properties agree coincide for all inputs and
outputs.
By using different union members for audio and video filters
the type-unsafety of using the same functions for audio and video
lists will furthermore be more confined to formats.c than before.
When the new fields are used, they will also avoid allocations:
Currently something nearly equivalent to ff_default_query_formats()
is called after every successful call to a query_formats callback;
yet in the common case that the newly allocated AVFilterFormats
are not used at all (namely if there are no free links) these newly
allocated AVFilterFormats are freed again without ever being used.
Filters no longer using the callback will not exhibit this any more.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 17:48:25 +02:00
Andreas Rheinhardt
aa6360928e
avfilter/formats: Add function to create AVFilterFormats with one entry
...
Most instances ff_add_formats() actually only ever add one format;
this function can be used to simplify those callers.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 17:37:09 +02:00
Andreas Rheinhardt
628b30e886
avfilter/vf_fieldorder: Remove always-true check
...
A filter's formats.query callback is only called after all
the inputs and outputs have already been created.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 17:30:40 +02:00
Paul B Mahol
38b9dc98a8
avfilter/af_dynaudnorm: add support for filtering non-writable frames
...
Previously it would continue processing frame even if call
to make frame writable failed.
2021-10-05 16:28:47 +02:00
Paul B Mahol
fcbaeefb45
avfilter/af_dynaudnorm: fix possible clipping at start when alt-boundary mode is disabled
2021-10-05 15:40:45 +02:00
Paul B Mahol
3fe49b51fc
avfilter/af_speechnorm: fix possible memleak on error to make frame writable
...
Fix this by adding support for non-writable frames.
2021-10-05 14:49:44 +02:00
Andreas Rheinhardt
2ee4077248
avfilter/vf_morpho: Fix invalid frees on error
...
The current code used a pointer to an array (of arrays) that
is offset relative to the start of the actually allocated buffer.
Yet offsetting the pointer is only done on success, whereas the
freeing code believes it to have happened even on error.
So if any of the subarrays (or the subarrays' subarrays) can't
be successfully allocated, one gets a bad free in free_lut().
Furthermore, said offsetting is only permissible in case the
offsetted pointer points in the allocated buffer (here: in case
the LUT's min_r is <= 0), as pointer arithmetic is undefined
in case it exceeds the allocated object.
Moreover, in case one of the subarrays couldn't be allocated,
the code nevertheless tried to free the subarray's subarrays;
and in case one of the subarray's subarrays could not be allocated
successfully, there will be an invalid free, too, because the
pointers for the subarrays' subarrays are also offset compared
to the base pointer.
This commit fixes all of this, by using the actually allocated
pointer for freeing and by adding appropriate checks before
freeing the subarrays. The former also allows to distinguish
the cases in which the lut is currently only half-allocated due to
an error in an earlier allocation attempt from the success case.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-04 17:27:50 +02:00
Andreas Rheinhardt
806a91bd4c
avfilter/vf_morpho: Take pre-padding into account for LUT-reallocation
...
Fixes heap-buffer underflows.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-04 17:27:50 +02:00
Andreas Rheinhardt
0536c5a449
avfilter/vf_morpho: Factor out (re)allocating lut
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-04 17:27:50 +02:00
Andreas Rheinhardt
beded39b19
avfilter/vf_morpho: Fix leak of output frame on error
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-04 17:27:50 +02:00
Andreas Rheinhardt
2761a7403b
avfilter/avfilter: Make ff_tlog_ref() static
...
It allows compilers to inline the one and only call to this function
in its caller or even to optimize it away completely (this function
is empty in case TRACE is not defined).
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-03 22:54:54 +02:00
Paul B Mahol
9fbe54e4b2
avfilter/af_afwtdn: add internal timeline support
2021-10-03 13:06:57 +02:00
Paul B Mahol
24e349c74b
avfilter/vf_morpho: switch to internal timeline
2021-10-03 13:06:55 +02:00
Paul B Mahol
f9fc1fed29
avfilter/af_agate: switch to internal timeline
2021-10-03 13:06:54 +02:00
Paul B Mahol
8d13927340
avfilter/af_afftdn: switch to internal timeline
2021-10-03 13:06:44 +02:00
Wu Jianhua
e26c4d252f
avfilter/x86/vf_blend: unify indentation format
...
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-10-03 09:15:55 +02:00