• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Don't use stream side-data size · 68dd1e6a
    Andreas Rheinhardt authored
    av_stream_get_side_data() tells the caller whether a stream has side
    data of a specific type; if present it can also tell the caller the size
    of the side data via an optional argument. The Matroska muxer always
    used this optional argument, although it doesn't really need the size,
    as the relevant side-data are not buffers, but structures. So change
    this.
    
    Furthermore, relying on the size also made the code susceptible to
    a quirk of av_stream_get_side_data(): It only sets the size argument if
    it found side data of the desired type. mkv_write_video_color() checks
    for side-data twice with the same variable for the size without resetting
    the size in between; if the second type of side-data isn't present, the
    size will still be what it was after the first call. This was not
    dangerous in practice, as the check for the existence of the second
    side-data compared the size with the expected size, so it would only be
    problematic if lots of elements were to be added to AVContentLightMetadata.
    Reviewed-by: 's avatarJames Almer <jamrial@gmail.com>
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    68dd1e6a
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...
.mailmap 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...