[vlc-commits] nvdec: fix CPU output when the CPU pitch doesn't match the buffer pitch

Steve Lhomme git at videolan.org
Mon Jul 27 15:34:22 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul 24 15:08:21 2020 +0200| [9a5b5f872d1549e82c267bfdfe08c13e663d271d] | committer: Steve Lhomme

nvdec: fix CPU output when the CPU pitch doesn't match the buffer pitch

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a5b5f872d1549e82c267bfdfe08c13e663d271d
---

 modules/hw/nvdec/nvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index e3aeff2355..acf8e06a15 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -590,7 +590,7 @@ static int CUDAAPI HandlePictureDisplay(void *p_opaque, CUVIDPARSERDISPINFO *p_d
                 .dstMemoryType  = CU_MEMORYTYPE_HOST,
                 .dstHost        = plane.p_pixels,
                 .dstPitch       = plane.i_pitch,
-                .WidthInBytes   = i_pitch,
+                .WidthInBytes   = __MIN(i_pitch, (unsigned)plane.i_pitch),
                 .Height         = plane.i_visible_lines,
             };
             result = CALL_CUDA_DEC(cuMemcpy2DAsync, &cu_cpy, 0);



More information about the vlc-commits mailing list