这是indexloc提供的服务,不要输入任何密码
Skip to content

OOM probably due to bad file #1109

@Tolriq

Description

@Tolriq

Version

Media3 pre-release (alpha, beta or RC not in this list)

More version details

1.3 RC1

Devices that reproduce the issue

Not sure this is related to a specific device.
Last report on Crashlytics is "Motorola One Action" Android 11

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

I don't have one :( Probably triggered by some bad media.

Expected result

No crash or a way for the application to recover via standard ExoPlayer renderer errors.

Actual result

The app crash.

Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 416356563 byte allocation with 8388608 free bytes and 83MB until OOM, target footprint 457338320, growth limit 536870912
       at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java)
       at java.nio.DirectByteBuffer$MemoryRef.<init>(DirectByteBuffer.java:70)
       at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:258)
       at androidx.media3.decoder.DecoderInputBuffer.createReplacementByteBuffer(DecoderInputBuffer.java:241)
       at androidx.media3.decoder.DecoderInputBuffer.ensureSpaceForWrite(DecoderInputBuffer.java:195)
       at androidx.media3.exoplayer.source.SampleDataQueue.readSampleData(SampleDataQueue.java:292)
       at androidx.media3.exoplayer.source.SampleDataQueue.readToBuffer(SampleDataQueue.java:130)
       at androidx.media3.exoplayer.source.SampleQueue.read(SampleQueue.java:440)
       at androidx.media3.exoplayer.source.ProgressiveMediaPeriod.readData(ProgressiveMediaPeriod.java:499)
       at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$SampleStreamImpl.readData(ProgressiveMediaPeriod.java:969)
       at androidx.media3.exoplayer.BaseRenderer.readSource(BaseRenderer.java:524)
       at androidx.media3.exoplayer.audio.DecoderAudioRenderer.feedInputBuffer(DecoderAudioRenderer.java:520)
       at androidx.media3.exoplayer.audio.DecoderAudioRenderer.render(DecoderAudioRenderer.java:325)
       at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1102)
       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:541)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:250)
       at android.os.HandlerThread.run(HandlerThread.java:67)

The important thing is the value : 416356563 byte, that's 416Mb to decode a sample, this obviously can't be allocated.

While the root cause generating the wrong value would be nice to reproduce if one user finally contact me, I think that such errors should be caught and return a decoder error and not crash the app.

Media

I do not have a reproduction file.

Bug Report

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions