The buffer must remain valid throughout the life of the QImage and all copies that have not been modified or otherwise detached from the original buffer. The image does not delete the buffer at destruction. You can provide a function pointer cleanupFunction along with an extra pointer cleanupInfo that will be called when the last copy is destroyed.
https://stackoverflow.com/a/39420988 вот тут тоже что-то подобное делают, сначала задают qimage из qvideoframe, потом делают unmap, потом возвращают картинку. разве так данные не протухнут? чем это отличается от моего случая?