Since it is happening on certain devices, it could be possible that you are not getting the pixel format you are expecting.
Also if buffBlend
is for any reason shorter than buffOut
(which could potentially be caused by the bitmaps being different formats), you will get this exception when you try and get()
past the end of it.
EDIT:
You could change int filterInt = buffBlend.get();
to
int filterInt = 0;
if (buffBlend.position() < buffBlend.limit())
filterInt = buffBlend.get();
If you do that for both of your buffers, that should protect you against the exception, and blend with black when one image is bigger than the other.