[FFmpeg-devel] [PATCH] avcodec/v4l2_m2m: Fix segmentation fault due to a missing NULL check in v4l2_context.c

Nicolas George george at nsup.org
Tue Feb 18 13:56:03 EET 2025


Eslam Samy via ffmpeg-devel (HE12025-02-18):
> Hi Nicolas,

@anchor{What is top-posting?}
@section What is top-posting?

See @url{https://en.wikipedia.org/wiki/Posting_style#Top-posting}.

Instead, use trimmed interleaved/inline replies (@url{https://lists.ffmpeg.org/pipermail/ffmpeg-user/2017-April/035849.html, example}).

> The logic behind the change I made is explained here: Ticket #9722. I
> tried to fix the issue by adding a null check to prevent the
> segmentation fault when ctx->buffers is accessed before being
> initialized.

Can you confirm that your patch really fixes the issue? You need to
confirm you have tested two things: (1) the issue does happen with the
current code base and (2) the issue no longer happens with the patch.

I strongly suggest you neglected (1).

> Regarding the coding style, I reviewed the FFmpeg developer
> documentation, but I couldn't find any explicit rules on this matter.
> However, I completely understand the importance of adhering to
> FFmpeg's coding standards, and I would be happy to modify the patch to
> align with the style you suggest.

@item
No unnecessary parentheses, unless it helps readability:

For the rest, you are supposed to imitate the existing code. Feel free
to propose adding the rule about null and 0 comparisons.

Regards,

-- 
  Nicolas George


More information about the ffmpeg-devel mailing list