timothybrooks / hdr-plus

HDR+ Implementation
MIT License
587 stars 201 forks source link

Assertion failed: (size == (size_t)type().bytes() && "Error: Overflow computing total size of buffer."), #59

Closed YiFabao closed 4 years ago

YiFabao commented 4 years ago

I tried the newest code on my mac,
when run the produced hdrplus binary , it crashed because of the following error:

./hdrplus dng_images dst.png payload_N000.dng payload_N001.dng payload_N002.dng Opening dng_images/payload_N000.dng Opening dng_images/payload_N001.dng Opening dng_images/payload_N002.dng Opening dng_images/payload_N003.dng Opening dng_images/payload_N004.dng Assertion failed: (size == (size_t)type().bytes() && "Error: Overflow computing total size of buffer."), function check_overflow, file /Users/yifabao/CLionProjects/Halide/include/Halide.h, line 5502. Abort trap: 6


My mac info : Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

clang version 10.0.0 Target: x86_64-apple-darwin19.4.0 Thread model: posix InstalledDir: /usr/local/opt/llvm/bin

I don't know why ?

I debug found that in the code : Halide::Runtime::Buffer process() { const int width = burst.GetWidth(); // return -1 const int height = burst.GetHeight();// return -1

Raws.empty() == 1

and I tried on android , also make the same error

image

YiFabao commented 4 years ago

I have soloved it!

YiFabao commented 4 years ago

I have successfully executed on android ! image

f0enix commented 3 years ago

@YiFabao how did you solve it?

teboli commented 1 year ago

Hi, Even though it's a one-year question, the answer might help newcomers. It looks like the constructor for the HDRPlus object copies burst instead of passing it by reference, causing the object to recreate a Burst object from scratch with no raw images within. I changed in HDRPlus.cpp at line 23:

HDRPlus(Burst burst, const Compression c, const Gain g)

with the reference version:

HDRPlus(Burst& burst, const Compression c, const Gain g)

and it worked, actually passing the stack of raw frames collected in the main. Hope it helps!