mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-24 04:05:46 +08:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user