untrunc icon indicating copy to clipboard operation
untrunc copied to clipboard

Crash due to "Out of buffer"

Open JodiTheTigger opened this issue 6 years ago • 0 comments

I was trying to repair my video (taken from jailbroken samsung s4 running android 7.1.2) and the app kept crashing at the end of the file due to hitting the exception: https://github.com/ponchio/untrunc/blob/2953f36f81a02001fccce0778f156d67f72dfbec/atom.cpp#L282

I had to hack mp4.cpp changing https://github.com/ponchio/untrunc/blob/2953f36f81a02001fccce0778f156d67f72dfbec/mp4.cpp#L344 to

	while(offset < (mdat->contentSize() - 4)) {

and then it worked fine.

For some reason, offset was always 2 bytes short of the file length and the end, and so offset+1<<16 triggered the exception.

I'm happy as I have recovered my file, but just letting you know it wasn't straight forward.

JodiTheTigger avatar Nov 21 '18 00:11 JodiTheTigger