Skip to content

Commit

Permalink
Fix Segmentation fault in RNLDeinit().
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxia Liang <[email protected]>
  • Loading branch information
xiaoxial committed Jan 15, 2025
1 parent 5be0592 commit bb2bcd5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Library/Raisr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1856,15 +1856,17 @@ RNLERRORTYPE RNLDeinit()

for (int threadIdx = 0; threadIdx < gThreadCount; threadIdx++)
{
if (gIppCtx.specY[threadIdx])
if (gIppCtx.specY && gIppCtx.specY[threadIdx])
ippsFree(gIppCtx.specY[threadIdx]);
if (gIppCtx.pbufferY[threadIdx])
if (gIppCtx.pbufferY && gIppCtx.pbufferY[threadIdx])
ippsFree(gIppCtx.pbufferY[threadIdx]);
for (int i = 0; i < gPasses; i++)
{
SAFE_ARR_DELETE(gIppCtx.segZones[i][threadIdx].inYUpscaled);
SAFE_ARR_DELETE(gIppCtx.segZones[i][threadIdx].inYUpscaled32f);
SAFE_ARR_DELETE(gIppCtx.segZones[i][threadIdx].raisr32f);
if (gIppCtx.segZones && gIppCtx.segZones[i]) {
SAFE_ARR_DELETE(gIppCtx.segZones[i][threadIdx].inYUpscaled);
SAFE_ARR_DELETE(gIppCtx.segZones[i][threadIdx].inYUpscaled32f);
SAFE_ARR_DELETE(gIppCtx.segZones[i][threadIdx].raisr32f);
}
}
}
SAFE_DELETE(gPool);
Expand Down

0 comments on commit bb2bcd5

Please sign in to comment.