diff options
author | Niklas Haas <git@haasn.dev> | 2023-10-19 17:52:14 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2023-10-19 18:26:05 +0200 |
commit | 50cd363c01efab0ced53cfdeed2e9169fcfad7ac (patch) | |
tree | c3dabddb5db77223805c01bf9dcebb9a4e6ff5ae /video/mp_image.c | |
parent | d67b0022aa691bb7879be5841e4720f3c4b5c009 (diff) | |
download | mpv-50cd363c01efab0ced53cfdeed2e9169fcfad7ac.tar.bz2 mpv-50cd363c01efab0ced53cfdeed2e9169fcfad7ac.tar.xz |
video/mp_image: handle non-power-of-two alignment
Needed for odd formats like rgb24.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r-- | video/mp_image.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/mp_image.c b/video/mp_image.c index c3a6b50a78..5c4f30b686 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -69,7 +69,7 @@ static int mp_image_layout(int imgfmt, int w, int h, int stride_align, int alloc_w = mp_chroma_div_up(w, desc.xs[n]); int alloc_h = MP_ALIGN_UP(h, 32) >> desc.ys[n]; int line_bytes = (alloc_w * desc.bpp[n] + 7) / 8; - out_stride[n] = MP_ALIGN_UP(line_bytes, stride_align); + out_stride[n] = MP_ALIGN_NPOT(line_bytes, stride_align); out_plane_size[n] = out_stride[n] * alloc_h; } if (desc.flags & MP_IMGFLAG_PAL) |