felipecsl/GifImageView

java.lang.IllegalArgumentException: Bad position

Closed this issue · 3 comments

This is the following stacktrace happens when set bytes to the view

Caused by java.lang.IllegalArgumentException: Bad position (limit 34457): 34641
at java.nio.Buffer.positionImpl(Buffer.java:357)
at java.nio.Buffer.position(Buffer.java:351)
at com.felipecsl.gifimageview.library.GifHeaderParser.skip(GifHeaderParser.java:364)
at com.felipecsl.gifimageview.library.GifHeaderParser.skipImageData(GifHeaderParser.java:354)
at com.felipecsl.gifimageview.library.GifHeaderParser.readBitmap(GifHeaderParser.java:245)
at com.felipecsl.gifimageview.library.GifHeaderParser.readContents(GifHeaderParser.java:136)
at com.felipecsl.gifimageview.library.GifHeaderParser.readContents(GifHeaderParser.java:114)
at com.felipecsl.gifimageview.library.GifHeaderParser.parseHeader(GifHeaderParser.java:89)
at com.felipecsl.gifimageview.library.GifDecoder.read(GifDecoder.java:485)
at com.felipecsl.gifimageview.library.GifImageView.setBytes(GifImageView.java:56)

Fixed by #37

Solid work @andrewlord1990

Thanks, appreciate it!