projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce1ee09
)
Fix a potential out of array writing.
author
Mathieu Malaterre
<mathieu.malaterre@gmail.com>
Thu, 31 Jul 2008 14:53:14 +0000
(14:53 +0000)
committer
Benoit Fouet
<benoit.fouet@free.fr>
Thu, 31 Jul 2008 14:53:14 +0000
(14:53 +0000)
Patch by Mathieu Malaterre mathieu malaterre gmail com
Originally committed as revision 14487 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/rle.c
patch
|
blob
|
history
diff --git
a/libavcodec/rle.c
b/libavcodec/rle.c
index
802f7f3
..
6e468f8
100644
(file)
--- a/
libavcodec/rle.c
+++ b/
libavcodec/rle.c
@@
-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;
}