changeset 7455:0e9e36d55e5e libavcodec

Fix a potential out of array writing. Patch by Mathieu Malaterre mathieu malaterre gmail com
author benoit
date Thu, 31 Jul 2008 14:53:14 +0000
parents bb5e8cae1d71
children 211cca1e3f39
files rle.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rle.c	Thu Jul 31 12:56:56 2008 +0000
+++ b/rle.c	Thu Jul 31 14:53:14 2008 +0000
@@ -70,9 +70,9 @@
         } 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;
         }