1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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
This commit is contained in:
Mathieu Malaterre 2008-07-31 14:53:14 +00:00 committed by Benoit Fouet
parent ce1ee094d7
commit 0afdedcafb

View File

@ -70,9 +70,9 @@ int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, i
} else {
/* fall back on uncompressed */
count = count_pixels(ptr, w-x, bpp, 0);
if(out + bpp*count >= outbuf + out_size) return -1;
*out++ = (count ^ xor_raw) + add_raw;
if(out + bpp*count > outbuf + out_size) return -1;
memcpy(out, ptr, bpp * count);
out += bpp * count;
}