No description
Find a file
Andreas Rheinhardt eb998e33ef avformat/sccdec: Don't use uninitialized data, fix crash, simplify logic
Up until now, the scc demuxer not only read the line that it intends
to process, but also the next line, in order to be able to calculate
the duration of the current line. This approach leads to unnecessary
complexity and also to bugs: For the last line, the timing of the
next subtitle is not only logically indeterminate, but also
uninitialized and the same applies to the duration of the last packet
derived from it.* Worse yet, in case of e.g. an empty file, it is not
only the duration that is uninitialized, but the whole timing as well
as the line buffer itself.** The latter is used in av_strtok(), which
could lead to crashes. Furthermore, the current code always outputs
at least one packet, even for empty files.

This commit fixes all of this: It stops using two lines at a time;
instead only the current line is dealt with and in case there is
a packet after that, the duration of the last packet is fixed up
after having already parsed it; consequently the duration of the
last packet is left in its default state (meaning "unknown/up until
the next subtitle"). If no further line could be read, processing
is stopped; in particular, no packet is output for an empty file.

*: Due to stack reuse it seems to be zero quite often; for the same
reason Valgrind does not report any errors for a normal input file.
**: While ff_subtitles_read_line() claims to always zero-terminate
the buffer like snprintf(), it doesn't do so if it didn't read anything.
And even if it did, it would not necessarily help here: The current
code jumps over 12 bytes that it deems to have read even when it
hasn't.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 60e12318bb)
2022-01-11 15:15:53 +01:00
compat compat/cuda: correct ushort4 to use ushort 2021-02-22 17:03:52 +01:00
doc Update for 4.4.1 2021-09-08 22:45:01 +02:00
ffbuild ffbuild: Avoid using the --preprocessor argument to windres 2021-06-24 23:25:30 +03:00
fftools fftools/ffmpeg: Fix crash when flushing non-fully setup output stream 2021-10-08 11:31:37 -03:00
libavcodec avcodec/rasc: Fix potential use of uninitialized value 2022-01-11 15:15:53 +01:00
libavdevice avdevice/xv: Increase array size 2022-01-11 15:15:53 +01:00
libavfilter avfilter/vf_w3fdif: Fix segfault on allocation error 2022-01-11 15:15:53 +01:00
libavformat avformat/sccdec: Don't use uninitialized data, fix crash, simplify logic 2022-01-11 15:15:53 +01:00
libavresample avresample: remove deprecated attribute from the AVAudioResampleContext struct 2018-01-09 10:56:53 -03:00
libavutil avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results 2021-10-21 19:21:14 +02:00
libpostproc Bump Versions before release/4.4 branch 2021-03-20 01:01:12 +01:00
libswresample libswresample/audioconvert: Fix undefined NULL + 0 2021-04-02 21:39:54 +02:00
libswscale swscale/alphablend: Fix slice handling 2021-10-05 23:19:40 +02:00
presets
tests avformat/mpegts: add missing sample_rate value to Opus extradata 2021-05-02 20:54:59 -03:00
tools tools/cws2fws: Check read() for failure 2021-09-08 21:31:50 +02:00
.gitattributes fate: add SCC test 2017-01-27 17:06:42 +01:00
.gitignore tools/python: add script to convert TensorFlow model (.pb) to native model (.model) 2019-07-01 10:23:47 -03:00
.mailmap mailmap: add entry for myself 2021-03-09 02:09:55 +00:00
.travis.yml Merge commit '899ee03088' 2019-03-14 15:53:16 -03:00
Changelog Changelog: update 2021-10-23 23:31:29 +02:00
configure configure: Add missing libshine->mpegaudioheader dependency 2022-01-06 08:35:49 +01:00
CONTRIBUTING.md Add CONTRIBUTING.md 2016-09-18 10:02:13 +01:00
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md INSTALL.md: Fix Markdown formatting 2019-01-31 10:29:16 -09:00
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 avcodec: move core AVCodecContext functions from util.c to a new file 2021-03-19 15:35:35 -03:00
README.md Remove the ffserver program 2018-01-06 18:31:37 +00:00
RELEASE Update for 4.4.1 2021-09-08 22:45:01 +02:00
RELEASE_NOTES Update missed irc links 2021-06-18 20:53:56 +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.