Buffer Size Error Despite Buffer Allocation with a Correct API

Symptom

Possible Cause

1. The allocated buffer size is smaller than the input/output buffer size required by the format.

2. The buffer size input by the VPC API is normal and matches the input format. However, the buffer size exceeds the length of the actually allocated buffer. As a result, the end address is invalid.

Solution

1. Check the code and the buffer size requirement of the corresponding format by referring to Restrictions on Image Formats, Width and Height Alignment, and Buffers.

2. Add the log for printing the buffer length to the code and check whether the buffer size input by the VPC API is the same as the length of the actually allocated buffer.