Skip to content

Commit

Permalink
sws: check that dither array is not null before memset
Browse files Browse the repository at this point in the history
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jan 19, 2013
1 parent aef5c0b commit 89afa63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libswscale/swscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 89afa63

Please sign in to comment.