Chromium Code Reviews
DescriptionFix JNI reference leak in MediaCodecVideoDecoder
We currently leak one local reference to MediaCodecVideoDecoder in
every call to MediaCodecVideoDecoderFactory::CreateVideoDecoder. After
the decoder has been re-initialized 512 times, JNI will crash due to
local reference table overflow (max=512).
The actual leak is in the member initializer list of
MediaCodecVideoDecoder. This CL fixes the leak by adding a
ScopedLocalRefFrame outside of the ctor. All JNI code that originate
from a C++ thread (i.e. the entry point is not a Java thread) must use
a ScopedLocalRefFrame in order to avoid leaking local references.
BUG=webrtc:6969
,b/36713034
Review-Url: https://codereview.webrtc.org/2780273002
Cr-Commit-Position: refs/heads/master@{#17464}
Committed: https://chromium.googlesource.com/external/webrtc/+/e4cd15d379b1a0bf1f91aaf873cfa07b0998f295
Patch Set 1 #
Messages
Total messages: 13 (9 generated)
|
|||||||||||||||||||