Commit 0afdedca authored by Mathieu Malaterre's avatar Mathieu Malaterre Committed by Benoit Fouet

Fix a potential out of array writing.

Patch by Mathieu Malaterre mathieu malaterre gmail com

Originally committed as revision 14487 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent ce1ee094
...@@ -70,9 +70,9 @@ int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, i ...@@ -70,9 +70,9 @@ int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, i
} else { } else {
/* fall back on uncompressed */ /* fall back on uncompressed */
count = count_pixels(ptr, w-x, bpp, 0); count = count_pixels(ptr, w-x, bpp, 0);
if(out + bpp*count >= outbuf + out_size) return -1;
*out++ = (count ^ xor_raw) + add_raw; *out++ = (count ^ xor_raw) + add_raw;
if(out + bpp*count > outbuf + out_size) return -1;
memcpy(out, ptr, bpp * count); memcpy(out, ptr, bpp * count);
out += bpp * count; out += bpp * count;
} }
......
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