VideoFrame(Ref)::plane_data() methods return truncated buffer for the alpha plane of AV12 format.
As the FIXME comment in the methods have pointed out, the implementation are assuming that plane index and component index are interchangeable when calling format_info.scale_height(comp)
. The alpha channel of AV12's component index is 3 while the plane index is 2. Using the plane index as component index will cause plane_data()
to scale the frame height against the V component, which has half of the height of the alpha component. As a result, the buffer returned by plane_data()
has half of the expected size.