Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit b85afe1

Browse files
authored
Fix klocwork warning (#560)
Signed-off-by: Jun Tian <[email protected]>
1 parent f0d3941 commit b85afe1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Source/App/EbAppMain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/***************************************
1717
* Includes
1818
***************************************/
19+
#include <inttypes.h>
1920
#include <stdio.h>
2021
#include <stdlib.h>
2122
#include <signal.h>
@@ -252,7 +253,7 @@ int32_t main(int32_t argc, char* argv[])
252253
else {
253254
printf("Total Frames\t\tFrame Rate\t\tByte Count\t\tBitrate\n");
254255
}
255-
printf("%12llu\t\t%4.2f fps\t\t%10llu\t\t%5.2f kbps\n",
256+
printf("%12" PRIu64 "\t\t%4.2f fps\t\t%10" PRIu64 "\t\t%5.2f kbps\n",
256257
configs[instanceCount]->performanceContext.frameCount,
257258
frameRate,
258259
configs[instanceCount]->performanceContext.byteCount,

Source/App/EbAppProcessCmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ void fillSegmentOv(
10471047
#ifdef _WIN32
10481048
result = fscanf_s(config->segmentOvFile, "%u", &segmentNo);
10491049
#else
1050-
result = fscanf(config->segmentOvFile, "%d", &segmentNo);
1050+
result = fscanf(config->segmentOvFile, "%u", &segmentNo);
10511051
#endif
10521052
if (result == 1) {
10531053
for (uint32_t segment = 0; segment < segmentNo; segment++) {

Source/Lib/Codec/EbEncHandle.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/**************************************
1111
* Includes
1212
**************************************/
13+
#include <inttypes.h>
1314
#include <stdlib.h>
1415
#include <stdio.h>
1516
#include <inttypes.h>
@@ -400,8 +401,10 @@ EB_ERRORTYPE EbHevcInitThreadManagmentParams(){
400401
if (socket_id >= maxSize) {
401402
maxSize = maxSize * 2;
402403
lpGroup = (processorGroup*)realloc(lpGroup,maxSize * sizeof(processorGroup));
403-
if (lpGroup == (processorGroup*) EB_NULL)
404+
if (lpGroup == (processorGroup*) EB_NULL) {
404405
return EB_ErrorInsufficientResources;
406+
fclose(fin);
407+
}
405408
}
406409
lpGroup[socket_id].group[lpGroup[socket_id].num++] = processor_id;
407410
}
@@ -2858,7 +2861,7 @@ static void PrintLibParams(
28582861
SVT_LOG("\nSVT [config]: De-blocking Filter / SAO Filter\t\t\t\t\t\t: %d / %d ", !config->disableDlfFlag, config->enableSaoFlag);
28592862
SVT_LOG("\nSVT [config]: HME / UseDefaultHME\t\t\t\t\t\t\t: %d / %d ", config->enableHmeFlag, config->useDefaultMeHme);
28602863
SVT_LOG("\nSVT [config]: MV Search Area Width / Height \t\t\t\t\t\t: %d / %d ", config->searchAreaWidth, config->searchAreaHeight);
2861-
SVT_LOG("\nSVT [config]: HRD / VBV MaxRate / BufSize / BufInit\t\t\t\t\t: %d / %d / %d / %lld", config->hrdFlag, config->vbvMaxrate, config->vbvBufsize, config->vbvBufInit);
2864+
SVT_LOG("\nSVT [config]: HRD / VBV MaxRate / BufSize / BufInit\t\t\t\t\t: %d / %d / %d / %" PRIu64, config->hrdFlag, config->vbvMaxrate, config->vbvBufsize, config->vbvBufInit);
28622865

28632866
#ifndef NDEBUG
28642867
SVT_LOG("\nSVT [config]: More configurations for debugging:");

0 commit comments

Comments
 (0)