Prevent OOB write in soft_avc encoder

Soft avc encoder cached buffer sizes across a point where the sizes
could be reset by an app, allowing crafted requests to hit outside
of the current buffer. This remedies that by forcing buffer reallocation
with new sizes whenever the encoder state at such 'reset' points.

Bug: 35421151
Test: run POC with no crash
Change-Id: I8c689846142264f7b6a277332260a6bd8a2bd92d
(cherry picked from commit 463452a94907278ca5e4c5632e50bbe59e861544)
2 files changed