我要从文件中解压缩数据,代码如下:
FILE* fp2;
lzo_bytep in;
lzo_bytep out1;
lzo_uint out_len;
lzo_uint file_len;
lzo_uint new_len;
err = fopen_s(&fp2, "file1.txt", "r+");
long cur = ftell(fp2);
fseek(fp2, 0L, SEEK_END);
file_len = ftell(fp2);`
fseek(fp2, cur, SEEK_SET);
out_len=file_len*2;
out1 = (lzo_bytep)malloc(out_len);
int err1 = fread(out1, file_len, 1, fp2);
in = (lzo_bytep)malloc(IN_LEN);
int r = lzo1x_decompress(out1, out_len, in, &new_len, NULL);
IN_LEN的长度足够大,数组out1的空间也足够大,但是为什么VS不断报告访问冲突?