Crash from TextObjectFilterRender
Maintainers usually reply within 2 days
@pedroSG94 is already working on this.
Since Jun 6, 2025.
Assessment
This issue has not been assessed yet.
Description
Hi,
I noticed a new crash that happens sometimes when i add a TextObjectFilterRender overlay. I started happening after 2.5.7. The only addition I see that could be related is the abstract void disableResources() method.
This is the exception I get:
Fatal Exception: java.lang.IllegalArgumentException: bitmap is recycled
at android.opengl.GLUtils.texImage2D(GLUtils.java:152)
at com.pedro.encoder.input.gl.TextureLoader.load(TextureLoader.java:41)
at com.pedro.encoder.input.gl.render.filters.object.BaseObjectFilterRender.drawFilter(BaseObjectFilterRender.java:109)
at com.pedro.encoder.input.gl.render.filters.object.TextObjectFilterRender.drawFilter(TextObjectFilterRender.java:48)
at com.pedro.encoder.input.gl.render.filters.BaseFilterRender.draw(BaseFilterRender.java:72)
at com.pedro.encoder.input.gl.render.MainRender.drawFilters(MainRender.kt:69)
at com.pedro.library.view.GlStreamInterface.draw(GlStreamInterface.kt:280)
at com.pedro.library.view.GlStreamInterface.onFrameAvailable$lambda$4(GlStreamInterface.kt:295)
at com.pedro.library.view.GlStreamInterface.$r8$lambda$0B-KT4vcqgQlJR7AIT7c70zbmo0()
at com.pedro.library.view.GlStreamInterface$$ExternalSyntheticLambda3.run(D8$$SyntheticClass)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
line 41 in TextureLoader is
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmaps[i], 0);
I wrapped it in
if (!bitmaps[i].isRecycled()) {
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmaps[i], 0);
} else {
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888), 0);
}
and the exception doesn't happen anymore. Does this look like a good fix to you? @pedroSG94
- Dominant language
- Kotlin
- Stars
- 3k
- Forks
- 946
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pedroSG94/RootEncoder
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
pedroSG94/RootEncoder#2213 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
pedroSG94/RootEncoder#2207 · 1 reaction ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pedroSG94/RootEncoder#2203 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
pedroSG94/RootEncoder#2192 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pedroSG94/RootEncoder#2177 · 44 comments ·
Maintainers usually reply within 2 days
All issues in pedroSG94/RootEncoder
Similar issues
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
djazairdev/wilayas#23 ·
Maintainers usually reply within 1 day
-
[BUG] Navigation drawer drops library-name suffixes without ellipsis (1.0.8, NVIDIA Shield)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
damontecres/Wholphin#2069 ·
Maintainers usually reply within 1 day
-
Android (vision-camera-location): HybridLocationManager never quits its HandlerThread on disposeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
margelo/react-native-vision-camera#4217 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
saisaharsh3/Leftovers#13 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 67/100
navikt/esyfo-narmesteleder#700 ·
Maintainers usually reply within 1 day