Hi 0xBat

On Mon, Jan 05, 2026 at 02:11:45AM +0100, 0xBat via ffmpeg-devel wrote:
> Validate return value of av_malloc for dynamic_setting to avoid null pointer 
> dereference.
> 
> Signed-off-by: 0xBat <[email protected]>
> ---
>  doc/examples/qsv_transcode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/doc/examples/qsv_transcode.c b/doc/examples/qsv_transcode.c
> index 13b4933041..c3f507e8e6 100644
> --- a/doc/examples/qsv_transcode.c
> +++ b/doc/examples/qsv_transcode.c
> @@ -351,6 +351,10 @@ int main(int argc, char **argv)
>      }
>      setting_number = (argc - 5) / 2;
>      dynamic_setting = av_malloc(setting_number * sizeof(*dynamic_setting));
> +    if (!dynamic_setting) {
> +        ret = AVERROR(ENOMEM);
> +        goto end;
> +    }

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to