[FFmpeg-devel] [PATCH 2/4] avformat/movenc: add support for writing Content Light Level Box

Michael Niedermayer michael at niedermayer.cc
Sat May 27 01:56:11 EEST 2017


On Wed, May 17, 2017 at 09:49:39PM -0300, James Almer wrote:
> As defined in "VP Codec ISO Media File Format Binding v1.0"
> https://github.com/webmproject/vp9-dash/blob/master/VPCodecISOMediaFileFormatBinding.md
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavformat/movenc.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index cd436df7a4..eab7bbc8a7 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1154,6 +1154,27 @@ static int mov_write_smdm_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
>      return update_size(pb, pos);
>  }
>  
> +static int mov_write_coll_tag(AVIOContext *pb, MOVTrack *track)
> +{
> +    int size = 0;
> +    int64_t pos;
> +    const AVContentLightMetadata *coll =
> +        (const AVContentLightMetadata *) av_stream_get_side_data(track->st,
> +                                             AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> +                                             &size);
> +    if (!size)
> +        return 0;

Is there anything that checks the validity of size for a
AVContentLightMetadata ?
(that is, is this checked anywhere from side data creation to
 its use here)

If not then this can be too small and crash


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170527/6071d02b/attachment.sig>


More information about the ffmpeg-devel mailing list