1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +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 Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
doc avfilter/vf_lut3d: allow to control when to upload CLUT for haldclut 2022-04-26 20:07:04 +02:00
ffbuild Fix libversion.sh for split version headers, to unbreak shared library builds 2022-03-17 11:11:17 +02:00
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 Keep including the full version.h when headers are included externally 2022-03-19 00:01:57 +02:00
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 avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec 2022-03-21 01:33:09 +01:00
.gitattributes fate: add SCC test 2017-01-27 17:06:42 +01:00
.gitignore gitignore: add config_components.h 2022-03-17 18:35:41 -03:00
.mailmap mailmap: add entry for myself 2021-03-09 02:09:55 +00:00
.travis.yml Merge commit '899ee03088d55152a48830df0899887f055da1de' 2019-03-14 15:53:16 -03:00
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 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 avformat/image2: add Jpeg XL as image2 format 2022-04-23 19:51:46 +02:00
Makefile Makefile: check config_components.h when comparing timestamps in component list files 2022-03-17 18:35:41 -03:00
README.md README: fix typo and description of libavfilter 2021-10-08 09:44:34 +05:30
RELEASE Bump Versions before release/4.4 branch 2021-03-20 01:01:12 +01: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 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.