{"action":"created","issue":{"url":"https://api.github.com/repos/imazen-discovery/test_issue_import/issues/5","labels_url":"https://api.github.com/repos/imazen-discovery/test_issue_import/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/imazen-discovery/test_issue_import/issues/5/comments","events_url":"https://api.github.com/repos/imazen-discovery/test_issue_import/issues/5/events","html_url":"https://github.com/imazen-discovery/test_issue_import/issues/5","id":56560071,"number":5,"title":"gdImageLine may misbehave or enter infinite loop if anti-aliasing is used and image size > 32768","user":{"login":"imazen-bot","id":10421256,"avatar_url":"https://avatars.githubusercontent.com/u/10421256?v=3","gravatar_id":"","url":"https://api.github.com/users/imazen-bot","html_url":"https://github.com/imazen-bot","followers_url":"https://api.github.com/users/imazen-bot/followers","following_url":"https://api.github.com/users/imazen-bot/following{/other_user}","gists_url":"https://api.github.com/users/imazen-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/imazen-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imazen-bot/subscriptions","organizations_url":"https://api.github.com/users/imazen-bot/orgs","repos_url":"https://api.github.com/users/imazen-bot/repos","events_url":"https://api.github.com/users/imazen-bot/events{/privacy}","received_events_url":"https://api.github.com/users/imazen-bot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-04T17:33:39Z","updated_at":"2015-02-04T17:33:39Z","closed_at":"2015-02-04T17:33:39Z","body":"Please look at the following piece of code:\n\n    \n    #include<stdio.h>\n    #include \"gd.h\"\n    \n    int main() {\n      /* Declare the image */\n      gdImagePtr im;\n      /* Declare output files */\n      FILE *pngout;\n      int black, white;\n      \n      im = gdImageCreateTrueColor(63318, 771);\n    \n      /* Allocate the color white (red, green and blue all maximum). */\n      white = gdImageColorAllocate(im, 255, 255, 255);  \n      /* Allocate the color white (red, green and blue all maximum). */\n      black = gdImageColorAllocate(im, 0, 0, 0);  \n    \n      /* white background */\n      gdImageFill(im, 1, 1, white);\n    \n      gdImageSetAntiAliased(im, black);\n    \n      /* This line fails! */\n      gdImageLine(im, 28562, 631, 34266, 750, gdAntiAliased);  \n    \n      /* Open a file for writing. \"wb\" means \"write binary\", important\n        under MSDOS, harmless under Unix. */\n      pngout = fopen(\"test.png\", \"wb\");\n    \n     /* Output the image to the disk file in PNG format. */\n      gdImagePng(im, pngout);\n    \n      /* Close the files. */\n      fclose(pngout);\n    \n      /* Destroy the image in memory. */\n      gdImageDestroy(im);\n    }\n    \n\nThe function gdImageLine seems to never return, if at least one of the coordinates is over 32768 and anti-aliasing is used.\n\nWith coordinates different from the above example, the function may return, but the line drawn is still incorrect.\n\nThis problem was originally reported to gnuplot (bug no. 3377536), but I was able to isolate it.\n\ngd version: 2.0.36\nsystem: Ubuntu linux 10.04.2 32-bit\n\nPéter Juhász\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/libgd/gd-libgd/issue/5\n- Originally reported by: Anonymous\n- Originally created at: 2011-07-26T12:53:44.669\n"},"comment":{"url":"https://api.github.com/repos/imazen-discovery/test_issue_import/issues/comments/72899708","html_url":"https://github.com/imazen-discovery/test_issue_import/issues/5#issuecomment-72899708","issue_url":"https://api.github.com/repos/imazen-discovery/test_issue_import/issues/5","id":72899708,"user":{"login":"imazen-bot","id":10421256,"avatar_url":"https://avatars.githubusercontent.com/u/10421256?v=3","gravatar_id":"","url":"https://api.github.com/users/imazen-bot","html_url":"https://github.com/imazen-bot","followers_url":"https://api.github.com/users/imazen-bot/followers","following_url":"https://api.github.com/users/imazen-bot/following{/other_user}","gists_url":"https://api.github.com/users/imazen-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/imazen-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imazen-bot/subscriptions","organizations_url":"https://api.github.com/users/imazen-bot/orgs","repos_url":"https://api.github.com/users/imazen-bot/repos","events_url":"https://api.github.com/users/imazen-bot/events{/privacy}","received_events_url":"https://api.github.com/users/imazen-bot/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T17:33:39Z","updated_at":"2015-02-04T17:33:39Z","body":"@Line 3716 src/gd.c\r\n{{{\r\n\r\n//infinite loop here\r\nnot exiting from this loop\r\n   while ((x >> 16) <= x2) \r\n   {\r\n        gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);\r\n\tgdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);\r\n\tx += (1 << 16);\r\n\ty += inc;\r\n   }\r\n\r\n}}}\r\n\n\n----------------------------------------\nOriginal comment by: Rashad M\n"}}