Commit 4245b119 authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

gdiplus: Set correct frame delay when GCE is missing.

parent 8c6e5788
......@@ -3302,6 +3302,7 @@ static void gif_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
if (delay)
{
LONG *value;
LONG frame_delay = 0;
delay->type = PropertyTagTypeLong;
delay->id = PropertyTagFrameDelay;
......@@ -3315,9 +3316,10 @@ static void gif_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
hr = IWICBitmapDecoder_GetFrame(decoder, i, &frame);
if (hr == S_OK)
{
get_gif_frame_property(frame, &GUID_MetadataFormatGCE, L"Delay", &value[i]);
get_gif_frame_property(frame, &GUID_MetadataFormatGCE, L"Delay", &frame_delay);
IWICBitmapFrameDecode_Release(frame);
}
value[i] = frame_delay;
}
}
......
......@@ -4859,6 +4859,24 @@ static const BYTE gif_2frame_no_pal[] = {
0x02,0x02,0x44,0x01,0x00, 0x3b
};
static const BYTE gif_2frame_missing_gce1[] = {
'G','I','F','8','7','a', 0x01,0x00, 0x01,0x00, 0x21, 0x02, 0x00,
0x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
0x02,0x02,0x44,0x01,0x00,
0x21,0xF9,0x04, 0x00,0x14,0x00,0x08, 0x00,
0x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
0x02,0x02,0x44,0x01,0x00, 0x3b
};
static const BYTE gif_2frame_missing_gce2[] = {
'G','I','F','8','7','a', 0x01,0x00, 0x01,0x00, 0x21, 0x02, 0x00,
0x21,0xF9,0x04, 0x00,0x0A,0x00,0x08, 0x00,
0x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
0x02,0x02,0x44,0x01,0x00,
0x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
0x02,0x02,0x44,0x01,0x00, 0x3b
};
static const BYTE gif_no_pal[] = {
'G','I','F','8','7','a', 0x01,0x00, 0x01,0x00, 0x27, 0x02, 0x00,
0x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
......@@ -4888,6 +4906,16 @@ static void test_gif_properties(void)
{ PropertyTagTypeLong, PropertyTagFrameDelay, 8, { 10,0,0,0,20,0,0,0 } },
{ PropertyTagTypeShort, PropertyTagLoopCount, 2, { 1,0 } },
};
static const struct property_test_data gif_2frame_missing_gce1_props[] =
{
{ PropertyTagTypeLong, PropertyTagFrameDelay, 8, { 0,0,0,0,20,0,0,0 } },
{ PropertyTagTypeShort, PropertyTagLoopCount, 2, { 1,0 } },
};
static const struct property_test_data gif_2frame_missing_gce2_props[] =
{
{ PropertyTagTypeLong, PropertyTagFrameDelay, 8, { 10,0,0,0,10,0,0,0 } },
{ PropertyTagTypeShort, PropertyTagLoopCount, 2, { 1,0 } },
};
static const struct property_test_data gif_no_pal_props[] =
{
{ PropertyTagTypeLong, PropertyTagFrameDelay, 4, { 0,0,0,0 } },
......@@ -4906,6 +4934,8 @@ static void test_gif_properties(void)
giftest(animatedgif, animatedgif_props, 2),
giftest(gif_2frame_global_pal, gif_2frame_global_pal_props, 2),
giftest(gif_2frame_no_pal, gif_2frame_no_pal_props, 2),
giftest(gif_2frame_missing_gce1, gif_2frame_missing_gce1_props, 2),
giftest(gif_2frame_missing_gce2, gif_2frame_missing_gce2_props, 2),
giftest(gif_no_pal, gif_no_pal_props, 1),
#undef giftest
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment