[vlc-commits] copy: assert copy_pitch is not null

Alexandre Janniaux git at videolan.org
Tue Nov 26 13:58:05 CET 2019


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Tue Nov 26 10:56:41 2019 +0100| [97ae109a79055c2d08c3a63803cff6a998541218] | committer: Thomas Guillem

copy: assert copy_pitch is not null

copy_pitch = 0 is a developer error which leads to a bad configuration
of the filter and a division by zero. It can come from a badly
configured video format conversion.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/video_chroma/copy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index 57e2ba2385..2ad9d2b7a7 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -466,6 +466,7 @@ static void SSE_CopyPlane(uint8_t *dst, size_t dst_pitch,
                           unsigned height, int bitshift)
 {
     const size_t copy_pitch = __MIN(src_pitch, dst_pitch);
+    assert(copy_pitch > 0);
     const unsigned w16 = (copy_pitch+15) & ~15;
     const unsigned hstep = cache_size / w16;
     const unsigned cache_width = __MIN(src_pitch, cache_size);



More information about the vlc-commits mailing list