Fix return check in CFX_FolderFontInfo::ScanFile() fread.
authorTom Sepez <tsepez@chromium.org>
Thu, 30 Jul 2015 22:53:59 +0000 (15:53 -0700)
committerTom Sepez <tsepez@chromium.org>
Thu, 30 Jul 2015 22:53:59 +0000 (15:53 -0700)
If you want to check the number of bytes read, you need to
change the order of arguments.

TEST=testing/corpus/fx/mulobj/1/1_10_watermark.pdf.0.png
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1262453006 .

core/src/fxge/ge/fx_ge_fontmap.cpp

index 14427a5..9bbebd9 100644 (file)
@@ -1367,7 +1367,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
         }
         FX_DWORD face_bytes = nFaces * 4;
         uint8_t* offsets = FX_Alloc(uint8_t, face_bytes);
-        readCnt = FXSYS_fread(offsets, face_bytes, 1, pFile);
+        readCnt = FXSYS_fread(offsets, 1, face_bytes, pFile);
         if (readCnt != face_bytes) {
             FX_Free(offsets);
             FXSYS_fclose(pFile);