Fix heap OOB read in C2SoftApvDec

A state-tracking error in C2SoftApvDec when handling multi-frame APV
access units causes mWidth and mHeight to be set to the dimensions
of the last frame, while the output is copied from the primary frame's
smaller buffer. This mismatch leads to a heap out-of-bounds read.

This patch fixes the issue by only updating mWidth and mHeight from
the primary frame in process(), and adding validation and update
logic in outputBuffer() using the actual primary frame dimensions
extracted from the image buffer.

Bug: 501467247
Test: local test
Flag: EXEMPT BUGFIX
Low-Coverage-Reason: TEST_IN_POSTSUBMIT

TAG=agy
CONV=6d836493-f1b3-4534-83a8-b805271d79e8
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:f96778b1c09dadf119dc89ccdc030aafd2ca1232
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:15891c9875f6c8767e924cf374940183ec94c325
Merged-In: I0da9aac6c81130dbed10a9cc61e5d8d40c60c807
Change-Id: I0da9aac6c81130dbed10a9cc61e5d8d40c60c807
1 file changed