From 89afa635bf101e881ef7f70659f555806fdeae28 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 19 Jan 2013 22:46:34 +0100 Subject: sws: check that dither array is not null before memset Fixes null pointer dereference Signed-off-by: Michael Niedermayer --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index bf0c130..8227ff5 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -910,7 +910,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c, src2[0] = base; } - if (!srcSliceY && (c->flags & SWS_BITEXACT) && (c->flags & SWS_ERROR_DIFFUSION)) + if (!srcSliceY && (c->flags & SWS_BITEXACT) && (c->flags & SWS_ERROR_DIFFUSION) && c->dither_error[0]) for (i = 0; i < 4; i++) memset(c->dither_error[i], 0, sizeof(c->dither_error[0][0]) * (c->dstW+2)); -- cgit v1.1