[FFmpeg-trac] #8494(avformat:new): UBSan: outside the range of representable values of type 'long'

FFmpeg trac at avcodec.org
Wed Jan 22 19:40:57 EET 2020


#8494: UBSan: outside the range of representable values of type 'long'
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:  defect
  andreafioraldi                     |
               Status:  new          |                 Priority:  minor
            Component:  avformat     |                  Version:  git-
                                     |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Hi, run
 {{{
 ffmpeg -y -i ubsan_sbgdec_200 -c:v mpeg4 -c:a out.mp4
 }}}
 compiled with
 {{{
 -fsanitize=undefined
 }}}

 The output is similar to

 {{{
 ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
   built with clang version 8.0.0-3~ubuntu18.04.2 (tags/RELEASE_800/final)
   configuration: --cc=clang-8 --cxx=clang++-8 --ld=clang-8
   libavutil      56. 31.100 / 56. 31.100
   libavcodec     58. 54.100 / 58. 54.100
   libavformat    58. 29.100 / 58. 29.100
   libavdevice    58.  8.100 / 58.  8.100
   libavfilter     7. 57.100 /  7. 57.100
   libswscale      5.  5.100 /  5.  5.100
   libswresample   3.  5.100 /  3.  5.100
 Trailing options were found on the commandline.
 libavformat/sbgdec.c:200:14: runtime error: 6.66267e+30 is outside the
 range of representable values of type 'long'
 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
 libavformat/sbgdec.c:200:14 in
 ubsan_sbgdec_200: Invalid data found when processing input
 }}}

 Seems that, in the str_to_time function of libavformat/sbgdec.c, the line

 {{{
     *rtime = (hours * 3600LL + minutes * 60LL + seconds) * AV_TIME_BASE;
 }}}

 Cause an overflow of the int64_t pointed by rtime.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8494>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list