[FFmpeg-devel] [PATCH] avfilter/drawtext: make command processing error-resilient

Timo Rothenpieler timo at rothenpieler.org
Tue May 14 11:33:35 EEST 2019


On 10/05/2019 15:55, Gyan wrote:
> At present, if the command args passed to drawtext contain any invalid 
> values, ffmpeg may crash or, at best, stop drawing any text.
> Attached patch gets the filter to continue with existing parameters, if 
> not all of the changes can be parsed or applied. This allows users in 
> live processing to correct and resubmit.
> 
> Gyan

This patch has at least two mis-uses of av_freep(), which potentially 
lead to a crash.

> +        av_freep(old);
> +
> +        ctx->priv = new;

Should probably be av_freep(&old);

> +fail:
> +    av_log(ctx, AV_LOG_ERROR, "Failed to process command. Continuing with existing parameters.\n");
> +    av_freep(new);
> +    return ret;

Should probably be av_freep(&new);

I did not do a full review of the patch, just pointing out those issues 
Coverity found. See coverity CID 1445099.


Timo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4538 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190514/adff5ad0/attachment.bin>


More information about the ffmpeg-devel mailing list