[FFmpeg-devel] [PATCH 5/5] avformat/rtpdec_asf: fix leak in ff_wms_parse_sdp_a_line()

2025-06-28 Thread Lidong Yan
In ff_wms_parse_sdp_a_line(), it allocates memory in buf, but doesn't free buf when avformat_alloc_context() failed. Add av_free(buf) before return to prevent from leak. Signed-off-by: Lidong Yan <502024330...@smail.nju.edu.cn> --- libavformat/rtpdec_asf.c | 4 +++- 1 file changed, 3 insertions(+

[FFmpeg-devel] [PATCH 4/5] avcodec/sunrast: fix leak in sunrast_decode_frame()

2025-06-28 Thread Lidong Yan
In sunrast_decode_frame(), we use av_malloc_array() allocates memory to ptr and ptr2. However if buf_end - buf < 1, this function returns error code without freeing this memory thus cause a leak. Add av_freep() before return. Signed-off-by: Lidong Yan <502024330...@smail.nju.edu.cn> --- libavcode

[FFmpeg-devel] [PATCH 3/5] swscale/graph: fix leak in adapt_colors()

2025-06-28 Thread Lidong Yan
In adapt_colors(), ff_sws_lut3d_generate() allocates memory in lut. However if add_legacy_sws_pass() failed, lut leaks. free lut before return ret. Signed-off-by: Lidong Yan <502024330...@smail.nju.edu.cn> --- libswscale/graph.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[FFmpeg-devel] [PATCH 2/5] avformat/rtpdec_latm: fix leak in parse_fmtp_config()

2025-06-28 Thread Lidong Yan
av_mallocz() allocates memory in config, but we forget to free it if init_get_bits() failed. Replace return ret with goto end. Signed-off-by: Lidong Yan <502024330...@smail.nju.edu.cn> --- libavformat/rtpdec_latm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rt

[FFmpeg-devel] [PATCH 1/5] avcodec/utvideodec: fix leaks in decode_plane() and decode_plane10()

2025-06-28 Thread Lidong Yan
In decode_plane() and decode_plane10(), both of these two functions use build_buff() which allocates memory in vlc and multi. And both of them forget to release vlc and multi when build_buff report a symbol to fill slices with. Add cleanup label and goto cleanup first before return 0. Signed-off-b

[FFmpeg-devel] [PATCH 0/5] fix multiple memory leaks

2025-06-28 Thread Lidong Yan
This patch series fix multiple memory leaks in error path and early return point. -BEGIN PGP PUBLIC KEY BLOCK- mDMEaEpkmRYJKwYBBAHaRw8BAQdAGwGqH/Dwod+i6kR0/Rhn5GanJ7wK8mM9tWP/ W2qu8Ti0HTUwMjAyNDMzMDA1NkBzbWFpbC5uanUuZWR1LmNuiJkEExYKAEEWIQQC zskBcOehk1y8GoKZR31bPD+6owUCaEpkmQIbAwUJBaOagAUL

[FFmpeg-devel] [PATCH 0/5] fix multiple memory leaks

2025-06-28 Thread Lidong Yan
This patch series fix multiple memory leaks in error path and early return point. Lidong Yan (5): avcodec/utvideodec: fix leaks in decode_plane() and decode_plane10() avformat/rtpdec_latm: fix leak in parse_fmtp_config() swscale/graph: fix leak in adapt_colors() avcodec/sunrast: fix leak i

Re: [FFmpeg-devel] [PATCH 2/2] avformat/sapenc: fix leak in sap_write_header()

2025-06-28 Thread Lidong Yan
Michael Niedermayer writes: > please do the rename in a seperate patch > so there are 2 patches, this makes the changes clearer > Got it. Thanks for your review. Lidong ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/li

Re: [FFmpeg-devel] [PATCH v5 3/3] avformat/whip: fix typos

2025-06-28 Thread Jack Lau
> On Jun 29, 2025, at 11:11, Jack Lau wrote: > > Hi Timo, >> On Jun 29, 2025, at 06:49, Timo Rothenpieler wrote: >> >> I've actually cleaned this up a bit while trying to implement DTLS via >> schannel, and effectively removed the whole section: >> >>> https://github.com/BtbN/FFmpeg/commit/

Re: [FFmpeg-devel] [PATCH v5 3/3] avformat/whip: fix typos

2025-06-28 Thread Jack Lau
Hi Timo, > On Jun 29, 2025, at 06:49, Timo Rothenpieler wrote: > > I've actually cleaned this up a bit while trying to implement DTLS via > schannel, and effectively removed the whole section: > >> https://github.com/BtbN/FFmpeg/commit/b6794f1373fb07b791cfacd2189c7efc4d6bdbcc > > There's also

Re: [FFmpeg-devel] [PATCH] avformat/mpegts: Add AVFMT_FLAG_ALLOW_CODEC_CHANGES

2025-06-28 Thread Pavel Koshevoy
On Sat, Jun 28, 2025 at 5:03 PM Michael Niedermayer wrote: > Hi > > On Sun, Jun 22, 2025 at 12:10:30PM -0600, Pavel Koshevoy wrote: > > Make midstream AVStream.codecpar updates optional and disabled > > by default, so that avformat API clients can enable this feature > > explicitly when they add

Re: [FFmpeg-devel] [PATCH 1/2] Replace FFMIN/FFMAX by type specific macros

2025-06-28 Thread Kacper Michajlow
On Sat, 28 Jun 2025 at 20:57, Rémi Denis-Courmont wrote: > > Le lauantaina 28. kesäkuuta 2025, 17.35.17 Itä-Euroopan kesäaika Kacper > Michajlow a écrit : > > On Mon, 2 Jun 2025 at 17:06, Rémi Denis-Courmont wrote: > > > Le 31 mai 2025 20:40:40 GMT+03:00, Marton Balint a écrit > > > : > > > >On

Re: [FFmpeg-devel] [PATCH] libavcodec/utils: Ensure allocated buffer is zero-initialized

2025-06-28 Thread Xingjing Deng
Thank you very much — I think you've convinced me. This was my first time asking a question in the FFmpeg community, and my limited understanding of the code led to a false positive. I apologize for the delayed response, and I truly appreciate your time and help. Kacper Michajlow 于2025年6月27日周五 0

Re: [FFmpeg-devel] [PATCH] libavutil: fix memory leak of drmVersion

2025-06-28 Thread Tim Blechmann via ffmpeg-devel
--- Begin Message --- attached (don't have a git send-email setup here at the moment) On 6/28/25 05:47, Michael Niedermayer wrote: On Wed, Jun 25, 2025 at 10:26:16AM +0800, Tim Blechmann via ffmpeg-devel wrote: Date: Wed, 25 Jun 2025 10:26:16 +0800 From: Tim Blechmann To: ffmpeg-devel@ffmpeg.o

Re: [FFmpeg-devel] [PATCH] avcodec/rv60dec: Check ofs for overflows

2025-06-28 Thread Peter Ross
On Sat, Jun 28, 2025 at 02:21:57AM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 30 + 2147483647 cannot be represented in type > 'int' > Fixes: > 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-6568264620900352 > > Signed-off-by: Michael Niedermayer

Re: [FFmpeg-devel] [PATCH] avformat/mpegts: Add AVFMT_FLAG_ALLOW_CODEC_CHANGES

2025-06-28 Thread Michael Niedermayer
Hi On Sun, Jun 22, 2025 at 12:10:30PM -0600, Pavel Koshevoy wrote: > Make midstream AVStream.codecpar updates optional and disabled > by default, so that avformat API clients can enable this feature > explicitly when they add support for midstream codec changes. > --- > doc/APIchanges

Re: [FFmpeg-devel] [PATCH v5 3/3] avformat/whip: fix typos

2025-06-28 Thread Timo Rothenpieler
I've actually cleaned this up a bit while trying to implement DTLS via schannel, and effectively removed the whole section: https://github.com/BtbN/FFmpeg/commit/b6794f1373fb07b791cfacd2189c7efc4d6bdbcc There's also a bunch of other necessary UDP related fixes in tls.c. Don't try to use an h

Re: [FFmpeg-devel] [PATCH] avcodec/speexdec: consider differing frame sizes in remaining space check

2025-06-28 Thread Michael Niedermayer
On Fri, Jun 27, 2025 at 06:14:28PM +0200, Michael Niedermayer wrote: > Fixes: talk109-q5.spx > Regression since: f6986e75be87f512f65d64ac91ba19d505a8d210 > > Signed-off-by: Michael Niedermayer > --- > libavcodec/speexdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply [...

Re: [FFmpeg-devel] [PATCH] avformat/mov.c: Fix to allow custom udta tags through when export_all option specified.

2025-06-28 Thread Ken McGaugh
On Sun, 29 Jun 2025 at 08:33, Ken McGaugh wrote: > On Sun, 29 Jun 2025 at 7:44 AM, Baptiste Coudurier < > baptiste.coudurier-at-gmail@ffmpeg.org> wrote: > >> Hey Ken >> >> > On Jun 28, 2025, at 1:04 AM, Ken McGaugh wrote: >> > >> > On Sat, 28 Jun 2025 at 13:52, Baptiste Coudurier < >> > bapt

Re: [FFmpeg-devel] [PATCH v2 20/20] libavcodec/tests: fix gitignore hashtable

2025-06-28 Thread Michael Niedermayer
On Mon, Jun 23, 2025 at 07:41:52PM +0200, Nicolas Gaullier wrote: > Signed-off-by: Nicolas Gaullier > --- > libavcodec/tests/.gitignore | 1 + > 1 file changed, 1 insertion(+) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB For a strong democra

Re: [FFmpeg-devel] [PATCH 3/4] avfilter/vf_lut3d: fix leak if allocate_3dlut failed

2025-06-28 Thread Michael Niedermayer
On Fri, Jun 27, 2025 at 10:09:17PM +0800, Lidong Yan wrote: > In parse_cinespace(), memory allocated in in_prelut[] and out_prelut[] > would leak if allocate_3dlut() failed. Replace return ret with goto end > to free memory before return error code. > > Signed-off-by: Lidong Yan <502024330...@smai

Re: [FFmpeg-devel] [PATCH 2/4] avcodec/vorbisenc: fix leak if av_mallocz failed

2025-06-28 Thread Michael Niedermayer
On Fri, Jun 27, 2025 at 10:09:16PM +0800, Lidong Yan wrote: > In put_main_header(), av_mallocz() allocates memory to local variable > buffer, buffer leaks if av_mallocz() to *out failed. Add av_free(buffer) > before return error code. > > Signed-off-by: Lidong Yan <502024330...@smail.nju.edu.cn> >

Re: [FFmpeg-devel] [PATCH] avformat/mov.c: Fix to allow custom udta tags through when export_all option specified.

2025-06-28 Thread Ken McGaugh
On Sun, 29 Jun 2025 at 7:44 AM, Baptiste Coudurier < baptiste.coudurier-at-gmail@ffmpeg.org> wrote: > Hey Ken > > > On Jun 28, 2025, at 1:04 AM, Ken McGaugh wrote: > > > > On Sat, 28 Jun 2025 at 13:52, Baptiste Coudurier < > > baptiste.coudurier-at-gmail@ffmpeg.org baptiste.coudurier-at-

Re: [FFmpeg-devel] [PATCH 2/2] avformat/sapenc: fix leak in sap_write_header()

2025-06-28 Thread Michael Niedermayer
On Wed, Jun 25, 2025 at 11:38:31PM +0800, Lidong Yan wrote: > In sap_write_header(), ff_format_set_url() assign new allocated new_url > to contexts[i]->url but forgot to free it later. Add for loop to free > contexts[i]->url before av_free(context). > > To prevent from writing free-for-loop in eve

Re: [FFmpeg-devel] [PATCH] avformat/mov.c: Fix to allow custom udta tags through when export_all option specified.

2025-06-28 Thread Baptiste Coudurier
Hey Ken > On Jun 28, 2025, at 1:04 AM, Ken McGaugh wrote: > > On Sat, 28 Jun 2025 at 13:52, Baptiste Coudurier < > baptiste.coudurier-at-gmail@ffmpeg.org > > wrote: > >> Hi >> >>> On Jun 27, 2025, at 5:46 PM, Ken McGaugh wrote: >>> >>>

Re: [FFmpeg-devel] [PATCH 1/2] Replace FFMIN/FFMAX by type specific macros

2025-06-28 Thread Rémi Denis-Courmont
Le lauantaina 28. kesäkuuta 2025, 17.35.17 Itä-Euroopan kesäaika Kacper Michajlow a écrit : > On Mon, 2 Jun 2025 at 17:06, Rémi Denis-Courmont wrote: > > Le 31 mai 2025 20:40:40 GMT+03:00, Marton Balint a écrit : > > >On Sat, 31 May 2025, Michael Niedermayer wrote: > > >> This allows adjusting t

Re: [FFmpeg-devel] [PATCH] doc: Remove libav-merge.txt

2025-06-28 Thread Alexander Strasser via ffmpeg-devel
--- Begin Message --- Hi Derek, I didn't see this before commenting on your libav-merge-next-commit removal patch. Should be OK if there is nothing of use in left in the section TODO/FIXME/UNMERGED . On 2025-06-23 21:15 +0100, Derek Buitenhuis wrote: > He's dead, Jim. I would appreciate it if y

Re: [FFmpeg-devel] [PATCH v4 3/3] avformat/whip: fix typos

2025-06-28 Thread Jack Lau
> On Jun 28, 2025, at 22:15, Marvin Scholz > wrote: > > On 28 Jun 2025, at 4:17, Jack Lau via ffmpeg-devel wrote: > >> AV_OPT_TYPE_INT,{ .i64 = 1200 },-1, >> INT_MAX, ENC }, >> -{ "authorization", "The optional Bearer token for WHIP >> Authorizat

[FFmpeg-devel] [PATCH v5 3/3] avformat/whip: fix typos

2025-06-28 Thread Jack Lau via ffmpeg-devel
--- Begin Message --- Remove redundant "WHIP: " prefix in log context since it already add whip context. Fix grammers in whip options descriptions Signed-off-by: Jack Lau --- libavformat/tls.c | 2 +- libavformat/whip.c | 152 ++--- 2 files changed, 77

Re: [FFmpeg-devel] [PATCH 1/2] Replace FFMIN/FFMAX by type specific macros

2025-06-28 Thread Kacper Michajlow
On Sat, 28 Jun 2025 at 16:35, Kacper Michajlow wrote: > > On Mon, 2 Jun 2025 at 17:06, Rémi Denis-Courmont wrote: > > > > > > > > Le 31 mai 2025 20:40:40 GMT+03:00, Marton Balint a écrit : > > > > > > > > >On Sat, 31 May 2025, Michael Niedermayer wrote: > > > > > >> This allows adjusting them to

Re: [FFmpeg-devel] [PATCH 1/2] Replace FFMIN/FFMAX by type specific macros

2025-06-28 Thread Kacper Michajlow
On Mon, 2 Jun 2025 at 17:06, Rémi Denis-Courmont wrote: > > > > Le 31 mai 2025 20:40:40 GMT+03:00, Marton Balint a écrit : > > > > > >On Sat, 31 May 2025, Michael Niedermayer wrote: > > > >> This allows adjusting them to exactly match whatever is fastest on > >> a given CPU for each type. > > > >

Re: [FFmpeg-devel] [PATCH 2/3] lavf: add and use AVRTCPSenderReport struct

2025-06-28 Thread Marvin Scholz
On 27 Jun 2025, at 23:50, Michael Niedermayer wrote: > On Tue, Jun 24, 2025 at 08:02:01PM +0200, Marvin Scholz wrote: >> This will be used in a future commit to expose the SR as side-data. >> --- >> libavcodec/defs.h | 14 ++ >> libavformat/rtpdec.c | 34 --

[FFmpeg-devel] [PATCH v2 3/3] lavf: add AV_PKT_DATA_RTCP_SR side data type

2025-06-28 Thread Marvin Scholz
--- libavcodec/packet.c | 1 + libavcodec/packet.h | 6 ++ libavformat/rtpdec.c | 18 ++ 3 files changed, 25 insertions(+) diff --git a/libavcodec/packet.c b/libavcodec/packet.c index 5104eb98b1..2aace71c7d 100644 --- a/libavcodec/packet.c +++ b/libavcodec/packet.c @@ -308

[FFmpeg-devel] [PATCH v2 2/3] lavf: add and use AVRTCPSenderReport struct

2025-06-28 Thread Marvin Scholz
This will be used in a future commit to expose the SR as side-data. --- libavcodec/defs.h | 14 ++ libavformat/rtpdec.c | 34 -- libavformat/rtpdec.h | 4 ++-- libavformat/rtspdec.c | 2 +- 4 files changed, 37 insertions(+), 17 deletions(-) diff

[FFmpeg-devel] [PATCH v2 1/3] lavf/rtpdec: fix RTCP SR packet length check

2025-06-28 Thread Marvin Scholz
The minimum valid packet length is 28, given that the length includes the packet header. This didn't cause any issues so far as the code did not care about the last two fields in the SR section, but will be relevant in a future commit. --- libavformat/rtpdec.c | 2 +- 1 file changed, 1 insertion(

Re: [FFmpeg-devel] [RFC] webp decoding

2025-06-28 Thread Michael Niedermayer
On Fri, Jun 27, 2025 at 01:54:04PM -1000, compn wrote: > On Thu, 26 Jun 2025 02:58:44 +0200, Michael Niedermayer wrote: > > > Hi > > > > some people use webp apparently, and we have no decoder > > > > There are 2 patchsets > > Thilos v13 (native decoder) > > Peters libwebp based one > > > > I t

Re: [FFmpeg-devel] [PATCH v4 3/3] avformat/whip: fix typos

2025-06-28 Thread Marvin Scholz
On 28 Jun 2025, at 4:17, Jack Lau via ffmpeg-devel wrote: > AV_OPT_TYPE_INT,{ .i64 = 1200 },-1, > INT_MAX, ENC }, > -{ "authorization", "The optional Bearer token for WHIP > Authorization", OFFSET(authorization), > +{ "authorization",

Re: [FFmpeg-devel] [PATCH v2] avcodec/vvc/refs: remove early return

2025-06-28 Thread Marvin Scholz
On 28 Jun 2025, at 3:42, Frank Plowman wrote: > On 27/06/2025 00:23, Marvin Scholz wrote: >> The ret value is checked later on again, so this check >> is redundant and would cause the frame to not be unrefd on >> failure as well. >> >> So remove this check and add one before av_frame_remove_sid

Re: [FFmpeg-devel] [PATCH 1/2] Replace FFMIN/FFMAX by type specific macros

2025-06-28 Thread Rémi Denis-Courmont
Le sunnuntai 8. kesäkuuta 2025, 2.29.05 Itä-Euroopan kesäaika Michael Niedermayer a écrit : > Hi > > On Wed, Jun 04, 2025 at 03:05:12AM +0200, Michael Niedermayer wrote: > [...] > > > > > #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= > > > > SWAP_tmp;}while(0) > > > > > > 1. I don't

Re: [FFmpeg-devel] [FATE PATCH] Properly list test errors when there are no failed tests

2025-06-28 Thread Martin Storsjö
On Sat, 28 Jun 2025, Michael Niedermayer wrote: Its a few years since the last change to fateserver, i think we dont have a script to update the checkout on the server from a git push. Its a while, i dont remember exactly :) so you have to update that checkout after pushing possibly I don't th

Re: [FFmpeg-devel] [PATCH] avformat/mov.c: Fix to allow custom udta tags through when export_all option specified.

2025-06-28 Thread Ken McGaugh
On Sat, 28 Jun 2025 at 13:52, Baptiste Coudurier < baptiste.coudurier-at-gmail@ffmpeg.org> wrote: > Hi > > > On Jun 27, 2025, at 5:46 PM, Ken McGaugh wrote: > > > > Hi, first time contributing to ffmpeg so I hope I got this right. We use > > custom udta tags in our pipeline but they were not

Re: [FFmpeg-devel] [PATCH 2/4] avfilter/asrc_sinc: fix leak in config_input()

2025-06-28 Thread Lidong Yan
Michael Niedermayer writes: > failure of av_tx_init() with your patch results in a leak: > I send a new patch in https://ffmpeg.org/pipermail/ffmpeg-devel/2025-June/345932.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/ma

[FFmpeg-devel] [PATCH v3] avfilter/asrc_sinc: fix leak in config_input()

2025-06-28 Thread Lidong Yan
In config_input(), fir_to_phase() allocates memory in h[longer], which would leak if av_calloc() to s->coeffs failed. lpf() allocates memory in h[0] and h[1], which would leak if fir_to_phase() failed. To fix this leak, add av_free(h[longer]) in as cleanup code, and replace return AVERROR* with got