message: Fix HDR ImageDecoder for width < 8 or > 32767
diff: @@ -374,6 +374,18 @@ LinearImage HDRDecoder::decode() {
  uint16_t magic;
  std::unique_ptr<uint8_t[]> rgbe(new uint8_t[width * 4]);
  + if (width < 8 || width > 32767) {
  + for (uint32_t y = 0; y < height; y++) {
  + math::float3* i = reinterpret_cast<math::float3*>(image.getPixelRef(0, y));
  + mStream.read((char*) &rgbe, width * 4);
  + // (rgb/256) * 2^(e-128)
  + size_t pixel = 0;
  + for (size_t x = 0; x < width; x++, pixel += 4) {
  + math::float3 v(rgbe[pixel], rgbe[pixel + 1], rgbe[pixel + 2]);
  + i[x] = v * std::ldexp(1.0f, rgbe[pixel + 3] - (128 + 8));
  + }
  + }
  + } else {
  for (uint32_t y = 0; y < height; y++) {
  //std::cout << "line: " << y << std::endl;
  mStream.read((char*) &magic, 2);
  @@ -419,6 +431,7 @@ LinearImage HDRDecoder::decode() {
  i[x] = v * std::ldexp(1.0f, e[0] - (128 + 8));
  }
  }
  + }
  return image;
  