diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-05-21 23:10:51 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-05-22 06:30:56 +0200 |
commit | 68dd1e6a57c8645656278b70f870a85e3789ec27 (patch) | |
tree | dd121ce26cefa1b641bdcd4cc02a1cf51adb814f /libavformat/afc.c | |
parent | d29c42974487d5fa0a5c1b05a09da5c5818ab63e (diff) | |
download | ffmpeg-68dd1e6a57c8645656278b70f870a85e3789ec27.tar.gz |
avformat/matroskaenc: Don't use stream side-data size
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: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/afc.c')
0 files changed, 0 insertions, 0 deletions