Nikolay Sivov (@nsivov) commented about dlls/mfplat/buffer.c:
CRITICAL_SECTION cs;
};
-static void copy_image(const struct buffer *buffer, BYTE *dest, LONG dest_stride, const BYTE *src,
LONG src_stride, DWORD width, DWORD lines)
+static HRESULT copy_image(const struct buffer *buffer, BYTE *dest, LONG dest_stride, const BYTE *src,
LONG src_stride, DWORD width, DWORD lines, DWORD dest_size)
{ MFCopyImage(dest, dest_stride, src, src_stride, width, lines);
- if (width > abs(dest_stride) || abs(dest_stride) * lines > dest_size)
return E_NOT_SUFFICIENT_BUFFER;
It would be valuable to test such error cases.