Opened 6 years ago

Closed 5 years ago

#7015 closed defect (worksforme)

UBSan: libavutil/eval.c:318:77: runtime error: division by zero

Reported by: tsmith Owned by:
Priority: normal Component: avutil
Version: git-master Keywords: ubsan
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

$ UBSAN_OPTIONS=print_stacktrace=1 ./ffmpeg -f flac -i test.flac -vn -threads 1 -f null -
ffmpeg version N-89982-g81d6501 Copyright (c) 2000-2018 the FFmpeg developers
  built with clang version 4.0.0-1ubuntu1~16.04.2 (tags/RELEASE_400/rc1)
  configuration: --cc=clang --cxx=clang++ --disable-libxcb --disable-xlib --disable-logging --disable-ffprobe --disable-ffplay --disable-sdl2 --disable-doc --disable-pthreads --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --disable-stripping --disable-runtime-cpudetect --disable-postproc --disable-securetransport --disable-iconv --disable-swscale --disable-dxva2 --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-everything --enable-encoder=pcm_s16le --disable-lzma --enable-protocol='file,pipe' --enable-muxer=null --enable-decoder=flac --enable-demuxer=flac --disable-pic --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-nvdec --disable-v4l2_m2m --disable-zlib --assert-level=2 --enable-filter=aresample
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58. 10.100 / 58. 10.100
  libavformat    58.  9.100 / 58.  9.100
  libavdevice    58.  1.100 / 58.  1.100
  libavfilter     7. 11.101 /  7. 11.101
  libswresample   3.  0.101 /  3.  0.101
[flac @ 0x619000000580] Warning: not compiled with thread support, using thread emulation
[flac @ 0x61b000000080] Could not find codec parameters for stream 0 (Audio: flac, mono, s16 (5 bit)): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flac, from 'test.flac':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Audio: flac, mono, s16 (5 bit)
[flac @ 0x619000000f80] Warning: not compiled with thread support, using thread emulation
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Finishing stream 0:0 without any data written to it.
[abuffer @ 0x610000001440] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
libavutil/eval.c:318:77: runtime error: division by zero
    #0 0x73cd4f in eval_expr (/home/user/code/FFmpeg/ffmpeg+0x73cd4f)
    #1 0x73cfda in av_expr_parse_and_eval (/home/user/code/FFmpeg/ffmpeg+0x73cfda)
    #2 0x77091d in set_string_number (/home/user/code/FFmpeg/ffmpeg+0x77091d)
    #3 0x76d8ad in av_opt_set (/home/user/code/FFmpeg/ffmpeg+0x76d8ad)
    #4 0x59afe3 in process_options /home/user/code/FFmpeg/libavfilter/avfilter.c:905:20
    #5 0x599d4f in avfilter_init_str /home/user/code/FFmpeg/libavfilter/avfilter.c:1054:19
    #6 0x5a3d25 in avfilter_graph_create_filter /home/user/code/FFmpeg/libavfilter/avfiltergraph.c:152:11
    #7 0x53d1ea in configure_input_audio_filter /home/user/code/FFmpeg/fftools/ffmpeg_filter.c:890:16
    #8 0x53d1ea in configure_input_filter /home/user/code/FFmpeg/fftools/ffmpeg_filter.c:981
    #9 0x53d1ea in configure_filtergraph /home/user/code/FFmpeg/fftools/ffmpeg_filter.c:1089
    #10 0x56af1d in flush_encoders /home/user/code/FFmpeg/fftools/ffmpeg.c:1873:23
    #11 0x56af1d in transcode /home/user/code/FFmpeg/fftools/ffmpeg.c:4655
    #12 0x55c87d in main /home/user/code/FFmpeg/fftools/ffmpeg.c:4812:5
    #13 0x7fed6e36a82f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
    #14 0x41a928 in _start (/home/user/code/FFmpeg/ffmpeg+0x41a928)

git commit 81d6501be77b273053a66eeced94d78e2021f1d1

Attachments (1)

test.flac (42 bytes ) - added by tsmith 6 years ago.

Download all attachments as: .zip

Change History (3)

by tsmith, 6 years ago

Attachment: test.flac added

comment:1 by Carl Eugen Hoyos, 6 years ago

Keywords: ubsan added
Version: unspecifiedgit-master

Not reproducible with gcc.

$ ffmpeg_g -i test.flac -threads 1 -f null -
ffmpeg version N-89989-g10bcc41 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --toolchain=gcc-usan
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58. 10.100 / 58. 10.100
  libavformat    58.  9.100 / 58.  9.100
  libavdevice    58.  1.100 / 58.  1.100
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[flac @ 0x72640c0] Could not find codec parameters for stream 0 (Audio: flac, mono, s16 (5 bit)): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flac, from 'test.flac':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Audio: flac, mono, s16 (5 bit)
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Finishing stream 0:0 without any data written to it.
[abuffer @ 0x74907c0] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
    Last message repeated 3 times
[abuffer @ 0x74907c0] Error setting option time_base to value 1/0.
[graph_0_in_0_0 @ 0x74906c0] Error applying options to the filter.
Error configuring filter graph
Conversion failed!

comment:2 by Elon Musk, 5 years ago

Resolution: worksforme
Status: newclosed

Not reproducible with clang 6.0:

ffmpeg -i ~/Downloads/test.flac -f null -
ffmpeg version N-92703-gc6e1966c1a Copyright (c) 2000-2018 the FFmpeg developers
  built with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
  configuration: --cc='ccache clang' --as='ccache clang' --disable-indevs --disable-outdevs --disable-autodetect --enable-gpl --enable-libpulse --enable-indev=lavfi --enable-indev=alsa --enable-indev=pulse --enable-nonfree --en
able-zlib --enable-openssl --enable-outdev=alsa --disable-static --enable-shared --enable-ladspa --enable-lv2 --enable-libbs2b --enable-libmp3lame --enable-librubberband --enable-libmysofa --enable-libx264 --enable-fontconfig -
-enable-libilbc --enable-libaom --enable-libfreetype --enable-libass --enable-libzimg --disable-stripping --samples=../fate-suite                                                                                                 
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 42.101 / 58. 42.101
  libavformat    58. 24.101 / 58. 24.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[flac @ 0xf33e00] Could not find codec parameters for stream 0 (Audio: flac, mono, s16 (5 bit)): unspecified sample rate                                                                                                          
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flac, from '/home/computer/Downloads/test.flac':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Audio: flac, mono, s16 (5 bit)
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[abuffer @ 0x1072340] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
    Last message repeated 3 times
[abuffer @ 0x1072340] Error setting option time_base to value 1/0.
[graph_0_in_0_0 @ 0x1072240] Error applying options to the filter.
Error reinitializing filters!
Error while filtering: Numerical result out of range
Finishing stream 0:0 without any data written to it.
[abuffer @ 0x1073f00] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
    Last message repeated 3 times
[abuffer @ 0x1073f00] Error setting option time_base to value 1/0.
[graph_0_in_0_0 @ 0x1073dc0] Error applying options to the filter.
Error configuring filter graph
Conversion failed!
Note: See TracTickets for help on using tickets.