Validate input dimensions in process()

Input dimensions are checked for supported range in set_dimensions
control call. Encoder returns an error for unsupported values in
this control call. But if the caller ignores this error and proceeds
to call process(), encoder wasn't checking the dimensions again.

Unsupported dimensions are now checked in process() call as well.

Note: This is relanding previously reverted commit

Bug: 172908358
Test: Poc in bug
Test: atest android.mediav2.cts
Test: atest
Change-Id: Icf3f296ab24432c680427a82da3505491acca3bd
1 file changed