summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-19 22:46:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-19 23:38:17 +0100
commit89afa635bf101e881ef7f70659f555806fdeae28 (patch)
tree7f0072b8260adf23e4c6e02c867094490c721cc9 /libswscale
parentaef5c0b68f31c4f4ff2654a8439dccf511c182df (diff)
sws: check that dither array is not null before memset
Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index bf0c13013a..8227ff50b2 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));