msvidc32: Reject incompatible output compression.

This commit is contained in:
Anton Baskanov 2024-10-30 17:09:54 +07:00
parent 681f407a81
commit bb4e050f66
2 changed files with 8 additions and 1 deletions

View file

@ -333,6 +333,13 @@ CRAM_DecompressQuery( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
TRACE("out->height = %ld\n", out->bmiHeader.biHeight );
TRACE("out->width = %ld\n", out->bmiHeader.biWidth );
if ((out->bmiHeader.biCompression != BI_RGB) &&
(out->bmiHeader.biCompression != BI_BITFIELDS))
{
TRACE("incompatible compression requested\n");
return ICERR_BADFORMAT;
}
if ((in->bmiHeader.biBitCount != out->bmiHeader.biBitCount) &&
(in->bmiHeader.biBitCount != 16 || out->bmiHeader.biBitCount != 24))
{

View file

@ -213,7 +213,7 @@ static void test_ICDecompressQuery(void)
ok(lr == ICERR_OK, "got lr %Id.\n", lr);
lr = ICDecompressQuery(hic, &format_cram16, &format_yvuv);
todo_wine ok(lr == ICERR_BADFORMAT, "got lr %Id.\n", lr);
ok(lr == ICERR_BADFORMAT, "got lr %Id.\n", lr);
ICClose(hic);
}