- If fseek() is failed, -1 is returned and errno is set to indicate the errors.
Change-Id: Id5cc540e185d310d287c417160ca321f4322a5a4
return FALSE;
}
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0) {
+ fprintf(stderr, "\t[BMP_testsuite] fseek failed \n");
+ fclose(fp);
+ return FALSE;
+ }
+
len = ftell(fp);
if (len < 0) {
fprintf(stderr, "\t[BMP_testsuite] ftell failed \n");
long size = 0;
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0)
+ return ;
+
size = (size_t)ftell(fp);
rewind(fp);
long size = 0;
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0)
+ return ;
+
size = (size_t)ftell(fp);
rewind(fp);
return FALSE;
}
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0) {
+ fprintf(stderr, "\t[JPEG_testsuite] fseek failed \n");
+ fclose(fp);
+ return FALSE;
+ }
+
len = ftell(fp);
if (len < 0) {
fprintf(stderr, "\t[JPEG_testsuite] ftell failed \n");
return FALSE;
}
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0) {
+ fprintf(stderr, "\t[JPEG_testsuite] fseek failed \n");
+ fclose(fp);
+ return FALSE;
+ }
+
len = ftell(fp);
if (len < 0) {
fprintf(stderr, "\t[JPEG_testsuite] ftell failed \n");
long size = 0;
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0)
+ return ;
+
size = (size_t)ftell(fp);
rewind(fp);
f = fopen(szPathName, "r");
if (f != NULL) {
- fseek(f, 0, SEEK_END);
- *pFileAttr = ftell(f);
+ if (fseek(f, 0, SEEK_END) < 0)
+ mm_util_stderror("fseek failed");
+ else
+ *pFileAttr = ftell(f);
fclose(f);
}
}
unsigned long long i = 4;
if (fseek(hFile, block_length + 4, SEEK_CUR) < 0) {
- mm_util_error("fseek was failed");
+ mm_util_stderror("fseek failed");
return MM_UTIL_ERROR_INVALID_OPERATION;
}
mm_util_sec_debug("new block length : %u", block_length);
if (fseek(hFile, block_length - JPG_BLOCK_SIZE_LENGTH, SEEK_CUR) < 0) {
- mm_util_error("fseek was failed");
+ mm_util_stderror("fseek failed");
return MM_UTIL_ERROR_INVALID_OPERATION;
}
}
ret = _ImgGetImageInfo(hFile, file_size, file_ext, type, width, height);
- fseek(hFile, 0, SEEK_SET);
+ if (fseek(hFile, 0, SEEK_SET) < 0)
+ mm_util_stderror("fseek failed");
+
fclose(hFile);
return ret;
return FALSE;
}
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0) {
+ fprintf(stderr, "\t[PNG_testsuite] fseek failed \n");
+ fclose(fp);
+ return FALSE;
+ }
+
len = ftell(fp);
if (len < 0) {
fprintf(stderr, "\t[PNG_testsuite] ftell failed \n");
long size = 0;
- fseek(fp, 0, SEEK_END);
+ if (fseek(fp, 0, SEEK_END) < 0)
+ return ;
+
size = (size_t)ftell(fp);
rewind(fp);