[FFmpeg-devel] [PATCH] avfilter: use ff_inlink_make_frame_writable()

Michael Niedermayer michael at niedermayer.cc
Thu Feb 9 01:10:06 EET 2023


On Tue, Feb 07, 2023 at 06:26:17PM +0100, Paul B Mahol wrote:
> On 2/6/23, Paul B Mahol <onemda at gmail.com> wrote:
> > Patch attached.
> >
> 
> Better patch attached.

>  avf_abitscope.c       |   11 +++++++++--
>  avf_ahistogram.c      |    9 +++++++--
>  avf_aphasemeter.c     |    9 +++++++--
>  avf_avectorscope.c    |    7 ++++++-
>  avf_showspectrum.c    |    5 ++++-
>  avf_showvolume.c      |    8 ++++++--
>  f_ebur128.c           |   10 ++++++++--
>  f_perms.c             |    3 ++-
>  framesync.c           |    2 +-
>  vf_cover_rect.c       |    9 +++++++--
>  vf_dedot.c            |    2 +-
>  vf_floodfill.c        |    5 ++++-
>  vf_lensfun.c          |    8 +++++++-
>  vf_overlay_cuda.c     |    3 ++-
>  vf_paletteuse.c       |    2 +-
>  vf_photosensitivity.c |    3 ++-
>  vf_repeatfields.c     |   34 +++++++++++++++++++++++++++-------
>  vf_signalstats.c      |   17 +++++++++++++----
>  vf_telecine.c         |   13 +++++++++++--
>  vf_vidstabdetect.c    |   12 +++++++++---
>  20 files changed, 134 insertions(+), 38 deletions(-)
> 8aabbe97177a141f13eb044580349e7ae1779b7f  0001-avfilter-use-ff_inlink_make_frame_writable.patch
> From 15f004ccb196e39c6c429e2c93041444c1a1e419 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda at gmail.com>
> Date: Mon, 6 Feb 2023 14:57:50 +0100
> Subject: [PATCH] avfilter: use ff_inlink_make_frame_writable()
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---

Seems to segfault here in fate unless i missed some patch 

==14233== Command: ./ffmpeg_g -nostdin -nostats -noauto_conversion_filters -cpuflags all -auto_conversion_filters -idct simple -hwaccel none -threads 1 -thread_type frame+slice -i fate-suite//smjpeg/scenwin.mjpg -vf trim=duration=0.5,perms=random,owdenoise=10:20:20:enable=not(between(t\\,0.2\\,1.2)) -an -f rawvideo -y /dev/null
==14233== 
ffmpeg version N-109788-g09fec9674b Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --enable-libspeex --enable-libvpx --enable-gpl --cc='ccache gcc' --enable-libopenjpeg --enable-pthreads --enable-debug=3 --cpu=core2 --enable-libvorbis --samples=fate-suite/ --enable-libx264 --enable-debug=3 --enable-libdc1394 --enable-libxvid --enable-libfreetype --enable-nonfree --enable-libmodplug --enable-libpulse --enable-libmp3lame --enable-version3 --enable-libbluray --enable-libxml2 --assert-level=2 --enable-libtheora --enable-openssl --enable-libcaca --enable-libopus --enable-libcdio --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libgsm --enable-libass --enable-frei0r --enable-libsoxr --enable-libfdk-aac --disable-optimizations --disable-stripping --extra-cflags='-Dav_always_inline=inline'
  libavutil      57. 44.100 / 57. 44.100
  libavcodec     59. 63.100 / 59. 63.100
  libavformat    59. 38.100 / 59. 38.100
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 56.100 /  8. 56.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
  libpostproc    56.  7.100 / 56.  7.100
[mjpeg @ 0x16a0cf00] EOI missing, emulating
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, smjpeg, from 'fate-suite//smjpeg/scenwin.mjpg':
  Duration: 00:00:08.11, start: 0.000000, bitrate: 557 kb/s
  Stream #0:0: Audio: adpcm_ima_smjpeg (APCM / 0x4D435041), 22050 Hz, 1 channels, s16
  Stream #0:1: Video: mjpeg (Baseline) (JFIF / 0x4649464A), yuvj420p(pc, bt470bg/unknown/unknown), 320x240 [SAR 1:1 DAR 4:3], 9 fps, 9 tbr, 1k tbn
Stream mapping:
  Stream #0:1 -> #0:0 (mjpeg (native) -> rawvideo (native))
[Parsed_perms_1 @ 0x16b61380] random seed: 0x4e2ee912
[swscaler @ 0x16b9df40] deprecated pixel format used, make sure you did set range correctly
==14233== Invalid read of size 4
==14233==    at 0x2C1C4E: ff_filter_frame (avfilter.c:1011)
==14233==    by 0x2D4842: filter_frame (f_perms.c:108)
==14233==    by 0x2C1A24: ff_filter_frame_framed (avfilter.c:969)
==14233==    by 0x2C20AD: ff_filter_frame_to_filter (avfilter.c:1113)
==14233==    by 0x2C22BD: ff_filter_activate_default (avfilter.c:1162)
==14233==    by 0x2C241D: ff_filter_activate (avfilter.c:1320)
==14233==    by 0x2C70AF: ff_filter_graph_run_once (avfiltergraph.c:1352)
==14233==    by 0x2C861F: push_frame (buffersrc.c:169)
==14233==    by 0x2C8C8C: av_buffersrc_add_frame_flags (buffersrc.c:258)
==14233==    by 0x26F938: ifilter_send_frame (ffmpeg.c:2038)
==14233==    by 0x26FCDC: send_frame_to_filters (ffmpeg.c:2124)
==14233==    by 0x2709D1: decode_video (ffmpeg.c:2310)
==14233==    by 0x27190B: process_input_packet (ffmpeg.c:2599)
==14233==    by 0x276B57: process_input (ffmpeg.c:3859)
==14233==    by 0x277012: transcode_step (ffmpeg.c:3994)
==14233==    by 0x277156: transcode (ffmpeg.c:4041)
==14233==    by 0x27768C: main (ffmpeg.c:4179)
==14233==  Address 0x16dc6770 is 112 bytes inside a block of size 480 free'd
==14233==    at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14233==    by 0x12B1201: av_free (mem.c:251)
==14233==    by 0x12B1249: av_freep (mem.c:261)
==14233==    by 0x12A1723: av_frame_free (frame.c:122)
==14233==    by 0x2C2999: ff_inlink_make_frame_writable (avfilter.c:1452)
==14233==    by 0x2D47F0: filter_frame (f_perms.c:100)
==14233==    by 0x2C1A24: ff_filter_frame_framed (avfilter.c:969)
==14233==    by 0x2C20AD: ff_filter_frame_to_filter (avfilter.c:1113)
==14233==    by 0x2C22BD: ff_filter_activate_default (avfilter.c:1162)
==14233==    by 0x2C241D: ff_filter_activate (avfilter.c:1320)
==14233==    by 0x2C70AF: ff_filter_graph_run_once (avfiltergraph.c:1352)
==14233==    by 0x2C861F: push_frame (buffersrc.c:169)
==14233==    by 0x2C8C8C: av_buffersrc_add_frame_flags (buffersrc.c:258)
==14233==    by 0x26F938: ifilter_send_frame (ffmpeg.c:2038)
==14233==    by 0x26FCDC: send_frame_to_filters (ffmpeg.c:2124)
==14233==    by 0x2709D1: decode_video (ffmpeg.c:2310)
==14233==    by 0x27190B: process_input_packet (ffmpeg.c:2599)
==14233==    by 0x276B57: process_input (ffmpeg.c:3859)
==14233==    by 0x277012: transcode_step (ffmpeg.c:3994)
==14233==    by 0x277156: transcode (ffmpeg.c:4041)
==14233==  Block was alloc'd at
==14233==    at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14233==    by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14233==    by 0x12B0E25: av_malloc (mem.c:105)
==14233==    by 0x12A16C5: av_frame_alloc (frame.c:106)
==14233==    by 0x2C8B55: av_buffersrc_add_frame_flags (buffersrc.c:233)
==14233==    by 0x26F938: ifilter_send_frame (ffmpeg.c:2038)
==14233==    by 0x26FCDC: send_frame_to_filters (ffmpeg.c:2124)
==14233==    by 0x2709D1: decode_video (ffmpeg.c:2310)
==14233==    by 0x27190B: process_input_packet (ffmpeg.c:2599)
==14233==    by 0x276B57: process_input (ffmpeg.c:3859)
==14233==    by 0x277012: transcode_step (ffmpeg.c:3994)
==14233==    by 0x277156: transcode (ffmpeg.c:4041)
==14233==    by 0x27768C: main (ffmpeg.c:4179)


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230209/f9e7a469/attachment.sig>


More information about the ffmpeg-devel mailing list