1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00
Go to file
Michael Niedermayer 1957095e80 avformat/swfdec: Check outlen before allocation
Fixes: Timeout (too long -> 241ms)
Fixes: 29083/clusterfuzz-testcase-minimized-ffmpeg_dem_SWF_fuzzer-6273684478230528

The source of the magic number is
A very quick simulation of the best case compression for "compress"
below is not nice written code as i did not expect I or anyone else
would ever see it again

I would have preferred some nicer expression or course, but thats
what it seems to be asymptotically. For smaller amounts of data a
tighter bound is possible but i saw no nice way to consider that
and it seems also overkill to try to do it more fine grained for
just this

main(){
    int64_t bits = 0;
    int bank = 256;
    int bitbank = 8;
    for(unsigned i = 0; i<1024*1024*1024*4U-100000;) {
        int word_size = bank-255;
        i += word_size;
        bits += bitbank;

        if (!(bank & (bank-1)))
            bitbank ++;
        bank++;
        if (bitbank > 16) {
            printf("BEST %f \n", 8.0 * i / bits );
            bank = 256;
            bitbank = 8;
        }
    }
}

above assumes i remembered correctly how the algorithm works but the
value was close to what actual compession of zeros gave

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-03-08 22:08:49 +01:00
compat compat/cuda: correct ushort4 to use ushort 2021-02-22 17:03:52 +01:00
doc doc/muxers.texi: Readd documentation removed accidentally 2021-03-07 01:25:32 +01:00
ffbuild ffbuild/common: Make deletion of templates possible 2021-02-07 09:45:04 +01:00
fftools ffprobe: switch to av_bprint_escape for XML escaping 2021-03-05 19:45:00 +02:00
libavcodec avcodec/mpeg4videodec: add forgotten flags to mpeg4_options 2021-03-08 19:22:21 +01:00
libavdevice Remove double ';' 2021-03-01 06:10:44 +01:00
libavfilter avfilter/buffersink: Postpone removal of av_[a]buffersink_params_alloc 2021-03-07 15:19:10 +01:00
libavformat avformat/swfdec: Check outlen before allocation 2021-03-08 22:08:49 +01:00
libavresample
libavutil avutil/{avstring,bprint}: add XML escaping from ffprobe to avutil 2021-03-05 19:45:00 +02:00
libpostproc lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bump 2021-01-01 14:14:57 +01:00
libswresample swresample/audioconvert: Fix left shift of negative value 2020-09-30 10:50:45 +02:00
libswscale swscale/x86/swscale: Remove unused ASM constants 2021-02-24 09:47:54 +01:00
presets
tests lavc: remove tests/options 2021-03-08 09:29:50 +01:00
tools avutil/{avstring,bprint}: add XML escaping from ffprobe to avutil 2021-03-05 19:45:00 +02:00
.gitattributes
.gitignore
.mailmap mailmap: add entry for myself 2020-07-13 11:24:04 +08:00
.travis.yml
Changelog avfilter: add msad video filter 2021-03-06 12:42:16 +01:00
configure Handle AVID MJPEG streams directly in the MJPEG decoder. 2021-02-25 11:46:28 +01:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md avfilter/vf_geq: Relicense to LGPL 2019-12-28 11:20:48 +01:00
MAINTAINERS MAINTAINERS: update names 2021-01-20 01:04:26 -06:00
Makefile tools/enum_options: fix build and add to Makefile 2020-11-20 15:20:24 +01:00
README.md
RELEASE RELEASE: We are after the 4.3 branch point, update for that 2020-06-10 00:20:24 +02:00

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.