[vlc-devel] [PATCH] copy: assert copy_pitch is not null
Steve Lhomme
robux4 at ycbcr.xyz
Fri Nov 22 16:44:12 CET 2019
LGTM
On 2019-11-22 16:39, Alexandre Janniaux wrote:
> 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.
> ---
> 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);
> --
> 2.24.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list