Skip to content

Bug: trying to show the sample AVIF file of "star-12bpc-with-alpha.avifs.avif", it fails #252

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

v3.0.5

The sample has this file here:

https://github.com/penfeizhou/APNG4Android/blob/master/app/src/main/assets/star-12bpc-with-alpha.avifs.avif

I opened it via a web browser, and it seems valid and a working animation.

So, I added it to the MainActivity class as such:

R.id.tv_avif -> {
    val intent = Intent(this, AnimationTestActivity::class.java)
    intent.putExtra(
        "files", arrayOf(
            "test.avif",
            "world-cup.avif",
            "wheel.avif",
            "star-12bpc-with-alpha.avifs.avif"
        )
    )
    startActivity(intent)
}

However, when I ran the app, it failed to show it and I got this in the logs:

Failed to parse AVIF image: BMFF parsing failed.
java.lang.NullPointerException: Attempt to invoke virtual method 'int org.aomedia.avif.android.AvifDecoder.getWidth()' on a null object reference
	at com.github.penfeizhou.animation.avif.decode.AVIFDecoder.read(AVIFDecoder.java:70)
	at com.github.penfeizhou.animation.avif.decode.AVIFDecoder.read(AVIFDecoder.java:26)
	at com.github.penfeizhou.animation.decode.FrameSeqDecoder$5.run(FrameSeqDecoder.java:237)
	at android.os.Handler.handleCallback(Handler.java:1095)
	at android.os.Handler.dispatchMessageImpl(Handler.java:135)
	at android.os.Handler.dispatchMessage(Handler.java:125)
	at android.os.Looper.loopOnce(Looper.java:269)
	at android.os.Looper.loop(Looper.java:367)
	at android.os.HandlerThread.run(HandlerThread.java:139)

How come?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions