Skip to content

Commit a072581

Browse files
committed
Move filterByteBuffer to local variable in getProcessedFrame() to prevent race condition
1 parent c8e4fda commit a072581

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

amazon-chime-sdk/src/main/java/com/amazonaws/services/chime/sdk/meetings/audiovideo/video/backgroundfilter/BackgroundFilterVideoFrameProcessor.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class BackgroundFilterVideoFrameProcessor(
5151

5252
private var cachedWidth: Int = 0
5353
private var cachedHeight: Int = 0
54-
private lateinit var filteredByteBuffer: ByteBuffer
5554

5655
private val defaultInputModelShape = ModelShape()
5756
private val channels = defaultInputModelShape.channels
@@ -124,6 +123,7 @@ class BackgroundFilterVideoFrameProcessor(
124123
filteredBitmap: Bitmap?,
125124
rgbaData: ByteBuffer
126125
): VideoFrame {
126+
var filteredByteBuffer: ByteBuffer
127127
if (filteredBitmap == null) {
128128
// Display original frame when there is an error getting segmentation mask and/or blurring.
129129
filteredByteBuffer = rgbaData

0 commit comments

Comments
 (0)