From 9ace87207d8b1a73df6e9795e2563b0f941f3014 Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 16 Sep 2021 18:36:42 -0700 Subject: [PATCH] FIFO: Fix a bug where running 18-bit or 24-bit color depth would cause a buffer overrun. (Regression from commit 329eade.) --- desmume/src/FIFO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/FIFO.cpp b/desmume/src/FIFO.cpp index 6fe2f8950..6025d0268 100755 --- a/desmume/src/FIFO.cpp +++ b/desmume/src/FIFO.cpp @@ -449,11 +449,11 @@ void _DISP_FIFOrecv_LineOpaque32_vec(u32 *__restrict dst) #else if (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev) { - ColorspaceConvertBuffer555To6665Opaque((u16 *)(disp_fifo.buf + disp_fifo.head), dst, GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16)); + ColorspaceConvertBuffer555To6665Opaque((u16 *)(disp_fifo.buf + disp_fifo.head), dst, GPU_FRAMEBUFFER_NATIVE_WIDTH); } else if (OUTPUTFORMAT == NDSColorFormat_BGR888_Rev) { - ColorspaceConvertBuffer555To8888Opaque((u16 *)(disp_fifo.buf + disp_fifo.head), dst, GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16)); + ColorspaceConvertBuffer555To8888Opaque((u16 *)(disp_fifo.buf + disp_fifo.head), dst, GPU_FRAMEBUFFER_NATIVE_WIDTH); } _DISP_FIFOrecv_LineAdvance(); #endif