abrenoch / hyperion-android-grabber

Screen grabber for hyperion
MIT License
194 stars 33 forks source link

another oom fix #103

Closed abrenoch closed 6 years ago

abrenoch commented 6 years ago

I noticed a couple bug reports in the play console that had OOM issues still - same problem we ran into before it appears. Seems like using the BufferdInputStream mostly solved the issue, but not entirely.

This fix simply checks the calculated message size, and only parses the response if that message size is equal to the number of bytes available in the input stream. We could maybe go with a less than or equal to, but this has proven to be effective in my testing so far.

This should put an end to any miscalculated response sizes!