[FFmpeg-devel] [PATCH] libavfilter: guard against ff_draw_init/ff_draw_init2 failures

Michael Niedermayer michael at niedermayer.cc
Tue Mar 4 01:56:32 EET 2025


On Thu, Feb 20, 2025 at 10:31:57PM -0500, Nil Fons Miret via ffmpeg-devel wrote:
> The return value of ff_draw_init and ff_draw_init2 are not checked in
> most usages. However, if they return an error, they don't get to the
> point where they set the attributes of the FFDrawContext. These
> functions are typically used in conjunction with ff_draw_color, which
> checks draw->desc->flags, causing a null pointer dereference.
> 
> Attaching patch with a fix to guard against this.

Is every of these ff_draw_init* calls able to fail ?
i see one is called with constants for example

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250304/e9ede33f/attachment.sig>


More information about the ffmpeg-devel mailing list