[FFmpeg-devel] [PATCH] avutil/opt: Restore NULL input handling to set_string_video_rate()

Jack Haughton jack.haughton at broadcom.com
Sun Aug 2 22:40:27 EEST 2020


Hello,

Apologies for the delay in replying. This patch is not to address a
specific problem that currently exists, but rather to restore the
robustness to invalid input that previously existed in this function. The
motivation for the patch is that we would like to merge a500b975 into our
local tree to gain support for gcc 10, but there are concerns about the
removal of the null check. av_parse_video_rate() passes its argument
directly to strcmp, which would cause undefined behaviour if the argument
was NULL.

Thanks,
Jack

On Fri, Jul 31, 2020 at 8:31 PM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> Hi
>
> On Fri, Jul 31, 2020 at 03:53:56PM +0100, Jack Haughton wrote:
> > Commit a500b975 removed NULL input handling from this function,
> > moving the check higher up the call tree in one branch. However,
> > there is another call to set_string_video_rate() which may pass
> > NULL, and future users of the function may not be clear that
> > a NULL check is required. This patch restores the NULL check to
> > avoid these problems.
>
> Does this affect something else than the seting based on defaults ?
> because the defaults should probably be valid values
> or if you disagree, iam curious where the default would be intentionally
> invalid
>
> thx
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Breaking DRM is a little like attempting to break through a door even
> though the window is wide open and the only thing in the house is a bunch
> of things you dont want and which you would get tomorrow for free anyway
>


-- 

Argon Design Ltd., Registration No. 06977690, a Broadcom Inc. company

Registered in England with registered office at St John's Innovation
Centre, Cowley Road, Cambridge, CB4 0WS


More information about the ffmpeg-devel mailing list