I try to make more correct patch. It works:
machine $ diff -u ffmpeg_frame.c.orig ffmpeg_frame.c
--- ffmpeg_frame.c.orig 2008-06-10 05:00:14.000000000 +0400
+++ ffmpeg_frame.c 2008-07-03 00:29:56.000000000 +0400
@@ -59,6 +59,7 @@
// Borrowed from gd.c
#define gdImageBoundsSafeMacro(im, x, y) (!((((y) < (im)->cy1) ||
((y) > (im)->cy2)) || (((x) < (im)->cx1) || ((x) > (im)->cx2))))
+#define gdImageBoundsSafeMacroFixed(x, y, w, h) (!(((y) < 0) || ((y)
>= (h)) || ((x) < 0) || ((x) >= (w))))
static int le_gd; // this is only valid after calling
// FFMPEG_PHP_FETCH_IMAGE_RESOURCE()
@@ -399,7 +400,7 @@
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
- if (gdImageBoundsSafeMacro(dest, x, y)) {
+ if (gdImageBoundsSafeMacroFixed(x, y, dest-
>sx, dest->sy)) {
/* copy pixel to gdimage buffer zeroing the alpha
channel */
dest->tpixels[y][x] = src[x] & 0x00ffffff;
} else {
machine $