ffmpeg: Fix memset size on ctts_data in mov_read_trun() (round 2)

The allocated size of sc->ctts_data is
(st->nb_index_entries + entries) * sizeof(*sc->ctts_data).

The size to memset at offset sc->ctts_data + sc->ctts_count should be
(st->nb_index_entries + entries - sc->ctts_count) *
sizeof(*sc->ctts_data))

The current code missed |entries| I believe, which was introduced in
https://patchwork.ffmpeg.org/patch/5541/.

However, after offline discussion, it seems the original code is much
more clear to read (before https://patchwork.ffmpeg.org/patch/5541/).

Hence this CL revert the memset logic to it's previous state by
remembering the |old_ctts_allocated_size|, and only memset the newly
allocated entries.

TBR=dalecurtis@chromium.org
BUG=812567

Change-Id: Ibe94c7138e5818bfaae76866bfa6619a9b8a2b6b
Reviewed-on: https://chromium-review.googlesource.com/934925
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/938142
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
2 files changed
tree: a387838f711ec6d86001eaf945a6e6a754628c99
  1. .gitattributes
  2. .gitignore
  3. .travis.yml
  4. BUILD.gn
  5. CONTRIBUTING.md
  6. COPYING.GPLv2
  7. COPYING.GPLv3
  8. COPYING.LGPLv2.1
  9. COPYING.LGPLv3
  10. CREDITS
  11. CREDITS.chromium
  12. Changelog
  13. INSTALL.md
  14. LICENSE.md
  15. MAINTAINERS
  16. Makefile
  17. OWNERS
  18. PRESUBMIT.py
  19. README.chromium
  20. README.md
  21. RELEASE
  22. chromium/
  23. codereview.settings
  24. compat/
  25. configure
  26. doc/
  27. ffbuild/
  28. ffmpeg_generated.gni
  29. ffmpeg_options.gni
  30. ffmpegsumo.ver
  31. fftools/
  32. libavcodec/
  33. libavdevice/
  34. libavfilter/
  35. libavformat/
  36. libavresample/
  37. libavutil/
  38. libpostproc/
  39. libswresample/
  40. libswscale/
  41. presets/
  42. tests/
  43. tools/
README.md

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.