Commit 317ca0d3 authored by Michael Niedermayer's avatar Michael Niedermayer

mpegvideo: fix out of heap array accesses

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 92c065f9
...@@ -1436,7 +1436,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, ...@@ -1436,7 +1436,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
y = (x * f) >> 16; y = (x * f) >> 16;
fr = (x * f) & 0xFFFF; fr = (x * f) & 0xFFFF;
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16; 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 { } else {
if (sy > ey) { if (sy > ey) {
...@@ -1453,7 +1453,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, ...@@ -1453,7 +1453,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
x = (y*f) >> 16; x = (y*f) >> 16;
fr = (y*f) & 0xFFFF; fr = (y*f) & 0xFFFF;
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16; 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;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment