diff options
author | Niklas Haas <git@haasn.dev> | 2021-12-05 21:24:57 +0100 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2021-12-05 21:24:57 +0100 |
commit | 036bda9166b6f50c096de72d4a110e83c1919403 (patch) | |
tree | f51b8b7bffba0641024e92130e488e85f0578e3c | |
parent | fc94c8c365ebeb038af6052bf4ea0506c1220559 (diff) | |
download | mpv-036bda9166b6f50c096de72d4a110e83c1919403.tar.bz2 mpv-036bda9166b6f50c096de72d4a110e83c1919403.tar.xz |
vo_gpu_next: fix UB in query_format()
`plane_data_from_imgfmt` doesn't zero-initialize the struct, so this
contained invalid values for e.g. `row_stride`, causing formats to
*randomly* fail. (Especially any formats with specific alignment
requirements)
Might fix #9424 and #9425.
-rw-r--r-- | video/out/vo_gpu_next.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 0d505f7913..d6e9cffd1f 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -820,7 +820,7 @@ static int query_format(struct vo *vo, int format) { struct priv *p = vo->priv; struct pl_bit_encoding bits; - struct pl_plane_data data[4]; + struct pl_plane_data data[4] = {0}; int planes = plane_data_from_imgfmt(data, &bits, format); if (!planes) return false; |