Skip to content

Commit

Permalink
mpegvideo: fix out of heap array accesses
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 317ca0d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Jun 9, 2012
1 parent 944b6a8 commit 997e769
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavcodec/mpegvideo.c
Expand Up @@ -1429,7 +1429,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
y = (x * f) >> 16;
fr = (x * f) & 0xFFFF;
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
buf[(y + 1) * stride + x] += (color * fr ) >> 16;
if(fr) buf[(y + 1) * stride + x] += (color * fr ) >> 16;
}
} else {
if (sy > ey) {
Expand All @@ -1446,7 +1446,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
x = (y*f) >> 16;
fr = (y*f) & 0xFFFF;
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
buf[y * stride + x + 1] += (color * fr ) >> 16;
if(fr) buf[y * stride + x + 1] += (color * fr ) >> 16;
}
}
}
Expand Down

0 comments on commit 997e769

Please sign in to comment.