Opened 7 years ago

Closed 7 years ago

#6387 closed defect (fixed)

ffmpeg crashes when pad filter is incorrectly specified

Reported by: Rollinnn Owned by:
Priority: important Component: avfilter
Version: git-master Keywords: crash pad
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
I tried to resize videos using command -vf "scale=800:-1, pad=800:480:x=-1:y=-1" But height of some videos become lagrer than 480. So ffmpeg tries to begin encoding, but just crashes. Probably it should give out error about incorrect parameters, but not crash.
How to reproduce:

G:\1_DVDs and Videos>ffmpeg -ss 00:10 -i "G:\1_DVDs and Videos\incorrectly_speci
fied_pad_crashes.avi" -to 00:30 -map 0:0 -vf "scale=800:-1, pad=800:480:x=-1:y=-
1" -vcodec libx264 -crf 0 -preset ultrafast -an -map_chapters -1 -map_metadata -
1 "G:\1_DVDs and Videos\incorrectly_specified_pad_crashes--.mkv"
ffmpeg version N-85604-g207e6de Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --e
nable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --
enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam
e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 61.100 / 55. 61.100
  libavcodec     57. 93.100 / 57. 93.100
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 86.100 /  6. 86.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, avi, from 'G:\1_DVDs and Videos\incorrectly_specified_pad_crashes.avi'
:
  Metadata:
    encoder         : Lavf57.72.101
  Duration: 00:00:10.01, start: 0.000000, bitrate: 201 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv
420p, 720x536 [SAR 1:1 DAR 90:67], 52 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.
98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 k
b/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[mpeg4 @ 03f75940] Video uses a non-standard and wasteful way to store B-frames
('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter wi
thout encoding but stream copy to fix it.
[libx264 @ 03f53700] using SAR=1341/1340
[libx264 @ 03f53700] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 03f53700] profile High 4:4:4 Predictive, level 3.1, 4:2:0 8-bit
[libx264 @ 03f53700] 264 - core 148 r2762 90a61ec - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deb
lock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1
trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=
6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compa
t=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0
intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, matroska, to 'G:\1_DVDs and Videos\incorrectly_specified_pad_crashes-
-.mkv':
  Metadata:
    encoder         : Lavf57.72.101
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 800x480 [SA
R 1341:1340 DAR 447:268], q=-1--1, 29.97 fps, 1k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.93.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (1)

incorrectly_specified_pad_crashes.avi (245.8 KB ) - added by Rollinnn 7 years ago.

Download all attachments as: .zip

Change History (3)

by Rollinnn, 7 years ago

comment:1 by Carl Eugen Hoyos, 7 years ago

Component: undeterminedavfilter
Keywords: crash pad added
Priority: normalimportant
Reproduced by developer: set
Status: newopen

For the given command line this is a regression since 57c3670896c69714ca1514728edf5ee48b2abcc9
The real issue seems related to ticket #6349 and this mailing list thread:
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-May/210687.html

Last edited 7 years ago by Carl Eugen Hoyos (previous) (diff)

comment:2 by Elon Musk, 7 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.