[vlc-devel] [PATCH] demux:mkv: make sure the mkv_track_t memory is initialized

Steve Lhomme robux4 at gmail.com
Wed Jul 12 14:38:19 CEST 2017


Oops, I was testing with a struct. It's not possible with a class that
holds objects (strings).

On Wed, Jul 12, 2017 at 2:35 PM, Steve Lhomme <robux4 at videolabs.io> wrote:
> Successive calls to ParseTrackEntry() may reuse the same stack memory and
> previous values not overridden by the new call.
> ---
>  modules/demux/mkv/matroska_segment_parse.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
> index a79cfa0e9f..9959616adb 100644
> --- a/modules/demux/mkv/matroska_segment_parse.cpp
> +++ b/modules/demux/mkv/matroska_segment_parse.cpp
> @@ -206,6 +206,7 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
>
>      /* Init the track */
>      mkv_track_t track;
> +    memset(&track, 0, sizeof(track));
>
>      track.b_default              = true;
>      track.b_enabled              = true;
> --
> 2.12.1
>


More information about the vlc-devel mailing list