← Back to team overview

hugin-devs team mailing list archive

[Bug 1046863] Re: Exception with output images bigger than 2gigapixel

 

LMAO!  This reminds me of
    http://www.youtube.com/watch?v=Qvk2wNWmB20

Solution: Use a 64bit version of Enblend
to construct images of 1GPx+.


** Changed in: enblend
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Hugin
Developers, which is subscribed to Enblend.
https://bugs.launchpad.net/bugs/1046863

Title:
  Exception with output images bigger than 2gigapixel

Status in Enblend:
  Invalid

Bug description:
  enblend throws the following exception when trying to blend panorama
  with more than 2 and less than 4gigapixels:

  enblend: an exception occured
  enblend: 
  Precondition violation!
  BasicImage::resize(int width, int height, value_type const &): width * height too large (integer overflow -> negative).

  The relevant part of the command line is the following:
  enblend -f80696x37979+1539+42210 -o output.tif -- input1.tif input2.tif

  How to reproduce:
  - take more than one tif file with alpha channels. It is needed to pass the loading of the input images
  - specify the output image size with -f widthxheight so that width*height becomes a negative number with 32bit integer arithmetics

  The root cause is in the vigra library. Enblend uses the BasicImage
  class from vigra. The implementation of this class uses integer
  arithmetics to calculate the amount of pixels for memory allocation.
  It also uses 32bit integer arithmetics to calculate offsets to access
  the memory during blending.

  Core dump can be provoked with the following command line, i.e. panorama with more than 4gigapixel:
  enblend -f65537x65536 -o output.tif -- input1.tif input2.tif

  width times height becomes a very small positive number, so the assert
  at the creation of the output image does not trigger any more,
  allowing the offset handling bug(s) in the vigra library to appear.

  I have checked with the following changesets:
  801:05e2d5c343d9 (head of the development git repo of vigra installed: commit c3a600900f31fd8112cf8f90bd510015feb76fbb)
  792:0c303c9ed15b (vigra used from the source tree of enblend)

  The bug exists in both cases. The difference is that the vigra version
  in the 792:.... changeset does not contain the assert for integer
  overflow, so coredump is the result in all of the cases.

  Proposal for fixing: replace the BasicImage class with another (if
  exists) which has no such bugs.

To manage notifications about this bug go to:
https://bugs.launchpad.net/enblend/+bug/1046863/+subscriptions


References