Skip to content

Commit bfdb477

Browse files
committed
get_av_to_uv_conversion_int: avoid NULL dereference
Avoid NULL pointer dereference for VERBOSE msg - in that case SWS fallback can be used but if --verbose passed, UG crashes on nullptr dereference.
1 parent fcda8ab commit bfdb477

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libavcodec/from_lavc_vid_conv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author Martin Piatka <[email protected]>
55
*/
66
/*
7-
* Copyright (c) 2013-2024 CESNET, z. s. p. o.
7+
* Copyright (c) 2013-2025 CESNET
88
* All rights reserved.
99
*
1010
* Redistribution and use in source and binary forms, with or without
@@ -2775,6 +2775,9 @@ get_av_to_uv_conversion(int av_codec, codec_t uv_codec)
27752775
{
27762776
av_to_uv_convert_t *ret =
27772777
get_av_to_uv_conversion_int(av_codec, uv_codec);
2778+
if (ret == NULL) {
2779+
return NULL;
2780+
}
27782781
MSG(VERBOSE, "converting %s to %s over %s\n",
27792782
av_get_pix_fmt_name(av_codec), get_codec_name(ret->dst_pixfmt),
27802783
get_codec_name(ret->src_pixfmt));

0 commit comments

Comments
 (0)