[FFmpeg-devel] [PATCH 2/2] avformat/movenc: allow hdlr name field to be empty

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Jun 20 00:32:20 EEST 2018


2018-06-18 16:34 GMT+02:00, Gyan Doshi <gyandoshi at gmail.com>:
> Fixes #7262.

> @@ -2613,11 +2615,15 @@ static int mov_write_hdlr_tag(
>      avio_wb32(pb, 0); /* reserved */
>      avio_wb32(pb, 0); /* reserved */
>      avio_wb32(pb, 0); /* reserved */
> -    if (!track || track->mode == MODE_MOV)
> -        avio_w8(pb, strlen(descr)); /* pascal string */
> -    avio_write(pb, descr, strlen(descr)); /* handler description */
> -    if (track && track->mode != MODE_MOV)
> -        avio_w8(pb, 0); /* c string */
> +    if (mov->empty_hdlr_name) /* expressly allowed by QTFF
> and not prohibited in ISO 14496-12 8.4.3.3 */
> +        avio_w8(pb, 0);
> +    else {
> +        if (!track || track->mode == MODE_MOV)
> +            avio_w8(pb, strlen(descr)); /* pascal string */
> +        avio_write(pb, descr, strlen(descr)); /* handler description */
> +        if (track && track->mode != MODE_MOV)
> +            avio_w8(pb, 0); /* c string */
> +    }

Apart from "missing braces":
Isn't the following sufficient and simpler?

if (mov->empty_hdlr_name)
    descr= "";

Carl Eugen


More information about the ffmpeg-devel mailing list