packages: php-ffmpeg/gdImageBoundsSafe.patch (NEW) - no point running gdIma...

glen glen at pld-linux.org
Thu Jun 25 22:07:41 CEST 2009


Author: glen                         Date: Thu Jun 25 20:07:41 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- no point running gdImageBoundsSafeMacro in a loop if all the values are known...

---- Files affected:
packages/php-ffmpeg:
   gdImageBoundsSafe.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-ffmpeg/gdImageBoundsSafe.patch
diff -u /dev/null packages/php-ffmpeg/gdImageBoundsSafe.patch:1.1
--- /dev/null	Thu Jun 25 22:07:41 2009
+++ packages/php-ffmpeg/gdImageBoundsSafe.patch	Thu Jun 25 22:07:36 2009
@@ -0,0 +1,34 @@
+--- ffmpeg-php-0.6.0/ffmpeg_frame.c~	2009-06-25 23:06:11.000000000 +0300
++++ ffmpeg-php-0.6.0/ffmpeg_frame.c	2009-06-25 23:06:13.837516462 +0300
+@@ -284,15 +284,14 @@
+     int x, y;
+     int *src = (int*)frame->data[0];
+ 
++	if (!gdImageBoundsSafeMacro(dest, width, height)) {
++		return -1;
++	}
++
+     for (y = 0; y < height; y++) {
+         for (x = 0; x < width; x++) {
+-		
+-			if (gdImageBoundsSafeMacro(dest, x, y)) {
+-                /* copy pixel to gdimage buffer zeroing the alpha channel */
+-                dest->tpixels[y][x] = src[x] & 0x00ffffff;
+-            } else {
+-                return -1;
+-            }
++			/* copy pixel to gdimage buffer zeroing the alpha channel */
++			dest->tpixels[y][x] = src[x] & 0x00ffffff;
+         }
+         src += width;
+     }
+@@ -342,8 +341,7 @@
+ 
+     FFMPEG_PHP_FETCH_IMAGE_RESOURCE(gd_img, &return_value);
+ 
+-    if (_php_avframe_to_gd_image(ff_frame->av_frame, gd_img,
+-            ff_frame->width, ff_frame->height)) {
++    if (_php_avframe_to_gd_image(ff_frame->av_frame, gd_img, ff_frame->width, ff_frame->height)) {
+         zend_error(E_ERROR, "failed to convert frame to gd image");
+     }
+ }
================================================================


More information about the pld-cvs-commit mailing list