Permalink
Browse files

avcodec/pngdsp: fix (un)signed type in end comparission

Fixes out of array accesses
Fixes Ticket2919

Found_by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information...
1 parent 0b46d6f commit 86736f59d6a527d8bc807d09b93f971c0fe0bb07 @michaelni michaelni committed Aug 30, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 libavcodec/pngdsp.c
View
@@ -31,7 +31,7 @@
static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
{
long i;
- for (i = 0; i <= w - sizeof(long); i += sizeof(long)) {
+ for (i = 0; i <= w - (int)sizeof(long); i += sizeof(long)) {
long a = *(long *)(src1 + i);
long b = *(long *)(src2 + i);
*(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);

0 comments on commit 86736f5

Please sign in to comment.