1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00
Go to file
Andreas Rheinhardt e4a26a64a8 avcodec/pgxdec: Fix issue with negative linesizes
The PGX decoder accesses the lines via code like
(PIXEL*)frame->data[0] + i*frame->linesize[0]/sizeof(PIXEL)
where PIXEL is a macro parameter. This code has issues with negative
linesizes, because the type of sizeof(PIXEL) is size_t, so
that on common systems i*linesize/sizeof(PIXEL) will
always be an unsigned type that is very large in case linesize is
negative. This happens to work*, but it is undefined behaviour
and e.g. leads to "src/libavcodec/pgxdec.c:114:1: runtime error:
addition of unsigned offset to 0x7efe9c2b7040 overflowed to 0x7efe9c2b6040"
errors from UBSAN.
Fix this by using (PIXEL*)(frame->data[0] + i*frame->linesize[0]).
This is allowed because linesize has to be suitably aligned.

*: Converting a negative int to size_t works by adding SIZE_MAX + 1
to the number, so that the result is off by (SIZE_MAX + 1) /
sizeof(PIXEL). Converting the pointer arithmetic (performed on PIXELs)
back to ordinary pointers is tantamount to multiplying by sizeof(PIXEL),
so that the result is off by SIZE_MAX + 1; but SIZE_MAX + 1 == 0
for the underlying pointers.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 01:28:03 +02:00
compat
doc avfilter/vf_lut3d: allow to control when to upload CLUT for haldclut 2022-04-26 20:07:04 +02:00
ffbuild
fftools doc/ffprobe: clarify that the input file is not optional 2022-04-21 12:34:04 +05:30
libavcodec avcodec/pgxdec: Fix issue with negative linesizes 2022-04-28 01:28:03 +02:00
libavdevice avdevice/dshow: Fix dshow device name/description 2022-04-09 21:29:39 +02:00
libavfilter avfilter/af_anlms: add timeline support 2022-04-27 21:30:43 +02:00
libavformat lavf/tls_mbedtls: add support for mbedtls version 3 2022-04-27 18:43:01 +02:00
libavutil avutil/timecode: use timecode fps for number of frame digits 2022-04-22 22:54:58 +02:00
libpostproc
libswresample swresample/rematrix: fix typo in clean_layout() 2022-03-28 00:07:42 -03:00
libswscale swscale: aarch64: Optimize the final summation in the hscale routine 2022-04-22 10:49:46 +03:00
presets
tests lavfi: Add blurdetect filter 2022-04-25 20:52:15 +02:00
tools
.gitattributes
.gitignore
.mailmap
.travis.yml
Changelog lavfi: Add blurdetect filter 2022-04-25 20:52:15 +02:00
configure lavfi: add vf_iccdetect for parsing ICC profiles 2022-04-23 21:51:55 +02:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md
MAINTAINERS avformat/image2: add Jpeg XL as image2 format 2022-04-23 19:51:46 +02:00
Makefile
README.md
RELEASE

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 means to alter decoded audio and video through a directed graph of connected 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.