Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7697 closed defect (fixed)

Segmentation fault while using silenceremove filter

Reported by: kdbeall Owned by:
Priority: important Component: avfilter
Version: 3.4 Keywords: silenceremove crash
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I suspect this is due to passing a negative value to stop_duration.

ffmpeg version:

ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg developers

built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100

Reproduction steps:

curl -O https://upload.wikimedia.org/wikipedia/commons/5/5d/01_Who_sings_of_England.ogg && ffmpeg -i 01_Who_sings_of_England.ogg -af silenceremove="stop_periods=1:stop_duration=-1" out.mp3

Change History (3)

comment:1 by kdbeall, 5 years ago

This could probably be solved with some error handling in https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/af_silenceremove.c

comment:2 by llogan, 5 years ago

Keywords: silenceremove added
Resolution: worksforme
Status: newclosed

Only builds from the current git master branch are supported here. A recent version provides an error message instead of a segmentation fault:

ffmpeg -i 01_Who_sings_of_England.ogg -af silenceremove="stop_periods=1:stop_duration=-1" out.wav
ffmpeg version N-93005-gd92f06eb66 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181127
  configuration: 
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
Input #0, ogg, from '01_Who_sings_of_England.ogg':
  Duration: 00:03:36.31, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: vorbis, 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      ENCODER         : VLC media player
Stream mapping:
  Stream #0:0 -> #0:0 (vorbis (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[silenceremove @ 0x562fb48b8bc0] Value -1.000000 for parameter 'stop_duration' out of range [0 - 2147.48]
    Last message repeated 1 times
[silenceremove @ 0x562fb48b8bc0] Error setting option stop_duration to value -1.
[Parsed_silenceremove_0 @ 0x562fb48b8ac0] Error applying options to the filter.
[AVFilterGraph @ 0x562fb48ae180] Error initializing filter 'silenceremove' with args 'stop_periods=1:stop_duration=-1'
Error reinitializing filters!
Failed to inject frame into filter network: Numerical result out of range
Error while processing the decoded data for stream #0:0
Conversion failed!

I didn't investigate which commit is responsible.

comment:3 by Carl Eugen Hoyos, 5 years ago

Component: undeterminedavfilter
Keywords: crash added
Priority: normalimportant
Reproduced by developer: set
Resolution: worksformefixed
Note: See TracTickets for help on using tickets.