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

Commit 39ba550

Browse files
authored
Fix static analysis warning (#565)
Signed-off-by: Jun Tian <[email protected]>
1 parent aac4c70 commit 39ba550

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Source/App/EbAppProcessCmd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,12 @@ void fillOneSegment(
992992
return;
993993
}
994994

995+
if (x1 > config->sourceWidth || x2 > config->sourceWidth ||
996+
y1 > config->sourceHeight || y2 > config->sourceHeight) {
997+
printf("\nSVT [Warning]: provided region is invalid, cannot perform caculation");
998+
return;
999+
}
1000+
9951001
uint32_t widthMinInLCU = MIN(x1, x2) / EB_SEGMENT_BLOCK_SIZE;
9961002
uint32_t widthMaxInLCU = MIN((MAX(x1, x2) + EB_SEGMENT_BLOCK_SIZE - 1) / EB_SEGMENT_BLOCK_SIZE,pictureWidthInLcu);
9971003

Source/Lib/Codec/EbEncHandle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ EB_ERRORTYPE EbHevcInitThreadManagmentParams(){
402402
maxSize = maxSize * 2;
403403
lpGroup = (processorGroup*)realloc(lpGroup,maxSize * sizeof(processorGroup));
404404
if (lpGroup == (processorGroup*) EB_NULL) {
405-
return EB_ErrorInsufficientResources;
406405
fclose(fin);
406+
return EB_ErrorInsufficientResources;
407407
}
408408
}
409409
lpGroup[socket_id].group[lpGroup[socket_id].num++] = processor_id;

0 commit comments

Comments
 (0)