Uh huh, which one? There are two in your original post.the .data() call triggers the crash:
Calling data() causes a deep copy of the data block if the QByteArray is currently shared. If the data block is very large this might fail. Since it fails:
it might help to consider what is different about that file. Is it huge?i get crashes with a certain, very specific input file.
The value of r won't change unless you change it. The memory address of the QByteArray may move if you do anything non-const to the byte array. If that happens the value of r, which has not changed, becomes an invalid pointer.does r change, even if i do not call resize()?
I am with lanz, perhaps you should be using standard memcpy() rather than some compiler internal function (any name starting with two underscores is compiler implementation reserved and should not come from user code).




Reply With Quote
Bookmarks