MediaUtils.mergePlayerInfo crashes with IllegalStateException on invalid PlayerInfo from remote session
Los mantenedores suelen responder en 4 días
@marcbaechinger ya está trabajando en esto.
Desde el 29/5/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Version
Media3 1.10.0
More version details
No response
Devices that reproduce the issue
- TCL Smart Tv Pro
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
No response
Reproduction steps
MediaUtils.mergePlayerInfo() throws an IllegalStateException via Preconditions.checkState() when a remote MediaSession sends a PlayerInfo update with an out-of-bounds currentMediaItemIndex. This crash is not catchable by the client app.
Note : this is probably related to #1447
Context
I develop an Android TV launcher that connects to active MediaSessions (via MediaSessionManager.getActiveSessions() → SessionToken.createSessionToken() → MediaController.Builder.buildAsync()) in order to display a "Now Playing" row. The launcher simply listens to player state/metadata changes and does not control playback.
Why this is a problem
The crash originates from a misbehaving remote app, not from the client. The client MediaController has no way to validate or reject the incoming PlayerInfo before mergePlayerInfo() is called.
The crash happens inside Media3's internal handler dispatch (MediaControllerStub.dispatchControllerTaskOnHandler), so there is no way for the client app to catch it — it's not wrapped in any client-facing callback.
Impact: For a launcher, any third-party app with a broken MediaSession can crash the entire launcher, which is the user's home screen.
Expected result
mergePlayerInfo() should handle an invalid index gracefully — for example by logging a warning and ignoring the update (or clamping the index) — rather than crashing the client process. The client should not be punished for a remote session sending inconsistent state.
Actual result
A remote app (in this case com.crunchyroll.crunchyroid, interface version=8) sends a PlayerInfo update where newIndex = 1 but the timeline only contains 1 item (count = 1). This triggers a fatal
IllegalStateException in MediaUtils.mergePlayerInfo():
Fatal Exception: java.lang.IllegalStateException: Invalid PlayerInfo update, old index: 0 (count=1), new index = 1, sent from com.crunchyroll.crunchyroid, interface version=8
at androidx.core.util.Preconditions.checkState(Preconditions.java:169)
at androidx.media3.session.MediaUtils.mergePlayerInfo(MediaUtils.java:150)
at androidx.media3.session.MediaControllerImplBase.onPlayerInfoChanged(MediaControllerImplBase.java:2965)
at androidx.media3.session.MediaControllerStub.lambda$onPlayerInfoChangedWithExclusions$12(MediaControllerStub.java:309)
at androidx.media3.session.MediaControllerStub.lambda$dispatchControllerTaskOnHandler$18(MediaControllerStub.java:431)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:328)
at android.app.ActivityThread.main(ActivityThread.java:8305)
Media
I don't have any media related to this issue as this is not originating from my app. I didn't reproduce it myself, it has only been seen on crashlytics.
Bug Report
- You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 998
- Merge medio
- 6 d 8 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de androidx/media
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 4 días
-
MediaSessionService: the platform session keeps every player command and publishes the whole queue until the session is added, e.g. after a sticky restartPosiblemente ocupada @marcbaechinger la tomó hace 1 día. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
androidx/media#3490 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 4 días
-
Gapless MP4/AAC from FFmpeg: padding derived as 0 from the edit list, so the rest of the last frame plays at each joinPosiblemente ocupada @rohitjoins la tomó hace 1 día. Abiertobug needs triage
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
androidx/media#3489 · 1 asignado ·
Los mantenedores suelen responder en 4 días
-
DTS-HD passthrough never retries a failed AudioTrack since the 1-second retry minimum (#3207)Posiblemente ocupada @microkatz la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
androidx/media#3487 · 1 asignado ·
Los mantenedores suelen responder en 4 días
-
Dolby Vision Profile 7 is sent to a Profile 5 decoder on DV displays without a Profile 7 decoderPosiblemente ocupada @microkatz la tomó hace 1 día. Abierto
Dificultad 4/5 1-2 días Aptitud para principiantes 48/100
androidx/media#3486 · 1 asignado ·
Los mantenedores suelen responder en 4 días
Todos los issues de androidx/media
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
DogFooding
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
OpenAEV-Platform/openaev#8768 ·
Los mantenedores suelen responder en 1 día
-
Empty trash: cancelling the password prompt, then swiping one note restores every trashed noteAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
federicoiosue/Omni-Notes#1039 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Dans-Plugins/Medieval-Roleplay-Engine#384 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día