--- ./image_captcha/image_captcha.user.inc.orig	2009-04-25 00:16:48.000000000 +0200
+++ ./image_captcha/image_captcha.user.inc	2009-08-13 21:37:58.000000000 +0200
@@ -263,7 +263,14 @@
 
     // get character dimensions for ttf fonts
     if ($font != 'BUILTIN') {
-      $bbox = imagettfbbox($font_size, 0, realpath($font), $character);
+      // a stupid GD bug in recent builds might return a faulty bounding box
+      // => in that case, try again, but not more than 10 times
+      $bbox = array(2 => -1);
+      $count = 0;
+      while ($bbox[2] < 0 && $count < 10) {
+        $count++;
+        $bbox = imagettfbbox($font_size, 0, realpath($font), $character);
+      }
     }
 
     // determine print position: at what coordinate should the character be
--- ./captcha.inc.orig	2009-06-19 15:04:00.000000000 +0200
+++ ./captcha.inc	2009-08-13 11:13:52.000000000 +0200
@@ -111,6 +111,9 @@
 function _captcha_required_for_user($captcha_sid, $form_id) {
   $captcha_session_status = db_result(db_query("SELECT status FROM {captcha_sessions} WHERE csid = %d", $captcha_sid));
 
+  if (!isset($_SESSION['captcha_success_form_ids'])) {
+    $_SESSION['captcha_success_form_ids'] = array();
+  }
   $captcha_success_form_ids = (array)($_SESSION['captcha_success_form_ids']);
   switch (variable_get('captcha_persistence', CAPTCHA_PERSISTENCE_SHOW_ALWAYS)) {
     case CAPTCHA_PERSISTENCE_SKIP_ONCE_SUCCESSFUL:
--- ./captcha.module.orig	2009-07-03 01:45:05.000000000 +0200
+++ ./captcha.module	2009-08-13 21:42:29.000000000 +0200
@@ -249,7 +249,7 @@
     'module' => $captcha_type_module,
     'type' => $captcha_type_challenge,
     'captcha_sid' => $captcha_sid,
-    'solution' => $captcha['solution'],
+    'solution' => isset($captcha['solution']) ? $captcha['solution'] : '',
   );
 
   return $element;
@@ -408,7 +408,7 @@
   // However, they will differ when the lifespan of the CAPTCHA session
   // does not equal the lifespan of a multipage form and then we have to
   // pick the right one.
-  $csid = $form_state['clicked_button']['#post']['captcha_sid'];
+  $csid = isset($form_state['clicked_button']['#post']['captcha_sid']) ? $form_state['clicked_button']['#post']['captcha_sid'] : 0;
 
   $solution = db_result(db_query('SELECT solution FROM {captcha_sessions} WHERE csid = %d AND status = %d', $csid, CAPTCHA_STATUS_UNSOLVED));
 
