title: QImage transform returns null
body: <p>I have an image, and I'm trying to transform selected part of the image using QImage::transformed(const QTransform &amp;matrix, Qt::TransformationMode mode) const method.
  But this method return null image. Also Qt wrote to std output:</p>
  
  <blockquote>
    <p>"Qimage: out of memory, returning null image."</p>
  </blockquote>
  
  <pre><code>    QImage img;
      img.load("D:\\3.png");
  
  QPolygonF polygonIn;
  polygonIn  &lt;&lt; QPointF(73, 63)
      &lt;&lt; QPointF(362, 22)
      &lt;&lt; QPointF(517, 325)
      &lt;&lt; QPointF(1, 210);
  
  QPolygonF polygonOut;
  polygonOut  &lt;&lt; QPointF(45, 39)
      &lt;&lt; QPointF(228, 13)
      &lt;&lt; QPointF(228, 198)
      &lt;&lt; QPointF(180, 198);
  
      QTransform transform;
  auto isOk = QTransform::quadToQuad(polygonIn, polygonOut, transform);
  if(!isOk)
      throw std::runtime_error("Transformation impossible with such parameters.");
  
  auto result = img.transformed(transform, Qt::TransformationMode::SmoothTransformation);
  </code></pre>
  
  <p>I've tried to debug QImage sources. On line 6633 of qimage.cpp </p>
  
  <pre><code>QImage dImage(wd, hd, target_format);
  QIMAGE_SANITYCHECK_MEMORY(dImage);
  </code></pre>
  
  <p>wd and hd values are huge. </p>
  
  <p>Maybe someone know how I can solve this problem. BTW I use qt 4.8.4.</p>