xiaozhuai / imageinfo

Free Palestine🇵🇸🇵🇸🇵🇸Cross platform super fast single header c++ library to get image size and format without loading/decoding. Support avif, bmp, cur, dds, gif, hdr (pic), heic (heif), icns, ico, j2k, jp2, jpeg (jpg), jpx, ktx, png, psd, qoi, tga, tiff (tif), webp ...
MIT License
106 stars 26 forks source link

RawDataReader 错误 #19

Closed Ding-yixia closed 1 month ago

Ding-yixia commented 1 month ago
class RawDataReader {
public:
    explicit RawDataReader(RawData data) : data_(data) {}

    inline size_t size() const { return data_.length; }

    inline void read(void *buf, off_t offset, size_t size) const { memcpy(buf, ((char *)data_.data) + offset, size); }

private:
    RawData data_;
}; 

当我批量判断 时,read 函数 出现错误

0x00007FFA714FFD36 (vcruntime140d.dll)处(位于 Compress_test.exe 中)引发的异常: 0xC0000005: 读取位置 0x000001F6BA5397EE 时发生访问冲突。

我的调用如下 unsigned char* ALLImgData; ALLImgData = new unsigned char[totalSize]; auto info = imageinfo::parse(imageinfo::RawData(ALLImgData, bufferSize));

xiaozhuai commented 1 month ago

@Ding-yixia 你好,请提供一个可以复现问题的可运行的最小代码。