[FFmpeg-devel] [PATCH] WebM mux/demux

Ronald S. Bultje rsbultje
Thu May 20 15:48:23 CEST 2010


Hi,

On Thu, May 20, 2010 at 4:27 AM, David Conrad <lessen42 at gmail.com> wrote:
> On May 19, 2010, at 6:14 PM, Ronald S. Bultje wrote:
>> Otherwise yes, but Baptiste is maintainer.
>
> You meant Aurel?

Yeah. If he doesn't respond, you can probably apply.

[..]
>      if (ebml_parse(matroska, ebml_syntax, &ebml)
>          || ebml.version > EBML_VERSION       || ebml.max_size > sizeof(uint64_t)
> -        || ebml.id_length > sizeof(uint32_t) || strcmp(ebml.doctype, "matroska")
> -        || ebml.doctype_version > 2) {
> +        || ebml.id_length > sizeof(uint32_t) || ebml.doctype_version > 2) {
>          av_log(matroska->ctx, AV_LOG_ERROR,
>                 "EBML header using unsupported features\n"
> -               "(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
> -               ebml.version, ebml.doctype, ebml.doctype_version);
> +               "(EBML version %"PRIu64", doc version %"PRIu64")\n",
> +               ebml.version, ebml.doctype_version);
> +        return AVERROR_PATCHWELCOME;
> +    }
> +    for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++)
> +        if (!strcmp(ebml.doctype, matroska_doctypes[i])) {
> +            matroska->doctype = matroska_doctypes[i];
> +            break;
> +        }
> +    if (!matroska->doctype) {
> +        av_log(s, AV_LOG_ERROR, "Unknown EBML doctype '%s'\n", ebml.doctype);
>          return AVERROR_PATCHWELCOME;
>      }
>      ebml_free(ebml_syntax, &ebml);

Isn't the last return a memleak? I think the ebml_free(..); should be
moved up to before the if().

Ronald



More information about the ffmpeg-devel mailing list