• Andreas Rheinhardt's avatar
    lavf/webm_chunk: Fix NULL dereference · 8c6ee762
    Andreas Rheinhardt authored
    The earlier version of the webm_chunk muxer had several bugs:
    
    1. If the first packet of an audio stream didn't have a PTS of zero,
    then no chunk will be started before a packet is delivered to the
    underlying Matroska/WebM muxer, i.e. the AVFormatContext used to write
    these packets had a NULL as AVIOContext for output. This is behind the
    crash in ticket #5752.
    
    2. If an error happens during writing a packet, the underlyimg
    Matroska/WebM muxer context is freed. This leads to a use-after-free
    coupled with a double-free in webm_chunk_write_trailer (which supposes
    that the underlying AVFormatContext is still valid).
    
    3. Even when no error occurs at all, webm_chunk_write_trailer is still
    buggy: After the underlying Matroska/WebM muxer has written its trailer,
    ending the chunk implicitly flushes it again which is illegal at this
    point.
    
    These bugs have been fixed.
    
    Fixes #5752.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    8c6ee762
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...