Fixed problem with outputting extra buffer bytes for certain resolutions (2864x1512) that cause incorrect overlapping artifacts when FFmpeg transcodes it. It looks like the Blackmagick RAW SDK may have aligned the buffer to a 1024-byte boundary, which cause an extra 512 bytes at the end of returned image buffer from GetResource for 2864x1512 videos. Actual image buffer size for rgba should be 2864x1512x4 = 17321472, which is 512 bytes less than what GetResourceSizeBytes was returning (17321984).
Fixed problem with outputting extra buffer bytes for certain resolutions (2864x1512) that cause incorrect overlapping artifacts when FFmpeg transcodes it. It looks like the Blackmagick RAW SDK may have aligned the buffer to a 1024-byte boundary, which cause an extra 512 bytes at the end of returned image buffer from GetResource for 2864x1512 videos. Actual image buffer size for rgba should be 2864x1512x4 = 17321472, which is 512 bytes less than what GetResourceSizeBytes was returning (17321984).
The problem is reproducible (and the fix verifiable) with the 2.8K samples found in the Blackmagic website e.g.: https://downloads.blackmagicdesign.com/products/blackmagicpocketcinemacamera/originals/the-chase/Empty-Wave-Spits.zip
Here is an example of the problematic overlap during playback of the FFmpeg transcoded output:![image](https://github.com/AkBKukU/braw-decode/assets/16812877/f2114921-e85f-4834-9298-6bf2ae9b37d5)