[FFmpeg-devel] [PATCH 2/2] lavf/mov: support gopro hero moments udta tag

Michael Niedermayer michael at niedermayer.cc
Sat Oct 15 01:58:44 EEST 2016


On Mon, Oct 10, 2016 at 12:00:01PM +0200, Jean Caillé wrote:
> From: Jean Caillé <jean at stupeflix.com>
> 
> ---
>  libavformat/mov.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index add1812..3e73320 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -268,6 +268,23 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext *pb, unsigned len)
>      return av_dict_set(&c->fc->metadata, key, buf, 0);
>  }
>  
> +static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len)
> +{
> +    int i, n_hmmt;
> +
> +    if (len < 2)
> +        return 0;
> +    if (c->ignore_chapters)
> +        return 0;
> +
> +    n_hmmt = avio_rb32(pb);
> +    for (i = 0; i < n_hmmt; i++) {
> +        int moment_time = avio_rb32(pb);

please add a eof check here
this loop could otherwise run for a long time eating both time and
memory even with a small file

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- 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/20161015/df4efb59/attachment.sig>


More information about the ffmpeg-devel mailing list