Skip to content

Commit 2476a4f

Browse files
armelvilmpiatka
authored andcommitted
from_lavc_vid_conv: guard NULL conversion in get_av_to_uv_conversion
get_av_to_uv_conversion_int() can return a valid struct with conversion == NULL (direct pixfmt map, decoder, or CUDA early-return paths), but since ecd4c53 the VERBOSE message unconditionally dereferences ret->conversion->uv_codec, SEGV when -t file: decodes to a directly-mapped format. Regression introduced in ecd4c53.
1 parent f7761c2 commit 2476a4f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/libavcodec/from_lavc_vid_conv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,8 @@ get_av_to_uv_conversion(int av_codec, codec_t uv_codec)
23532353
if (ret == NULL) {
23542354
return NULL;
23552355
}
2356-
if (ret->dst_pixfmt == ret->conversion->uv_codec) {
2356+
if (ret->conversion == NULL ||
2357+
ret->dst_pixfmt == ret->conversion->uv_codec) {
23572358
MSG(VERBOSE, "converting %s to %s\n",
23582359
av_get_pix_fmt_name(av_codec),
23592360
get_codec_name(ret->dst_pixfmt));

0 commit comments

Comments
 (0)