Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
629e7f44
Commit
629e7f44
authored
Sep 18, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Store GIF frame extensions in a dedicated Extensions structure.
parent
8e87b923
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
31 deletions
+35
-31
gifformat.c
dlls/windowscodecs/gifformat.c
+6
-6
ungif.c
dlls/windowscodecs/ungif.c
+15
-15
ungif.h
dlls/windowscodecs/ungif.h
+14
-10
No files found.
dlls/windowscodecs/gifformat.c
View file @
629e7f44
...
...
@@ -699,8 +699,8 @@ static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
}
/* look for the transparent color extension */
for
(
i
=
0
;
i
<
This
->
frame
->
ExtensionBlockCount
;
++
i
)
{
eb
=
This
->
frame
->
ExtensionBlocks
+
i
;
for
(
i
=
0
;
i
<
This
->
frame
->
Extension
s
.
Extension
BlockCount
;
++
i
)
{
eb
=
This
->
frame
->
Extension
s
.
Extension
Blocks
+
i
;
if
(
eb
->
Function
==
0xF9
&&
eb
->
ByteCount
==
4
)
{
if
((
eb
->
Bytes
[
0
]
&
1
)
==
1
)
{
trans
=
(
unsigned
char
)
eb
->
Bytes
[
3
];
...
...
@@ -854,11 +854,11 @@ static const void *get_GCE_data(GifFrameDecode *This)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
frame
->
ExtensionBlockCount
;
i
++
)
for
(
i
=
0
;
i
<
This
->
frame
->
Extension
s
.
Extension
BlockCount
;
i
++
)
{
if
(
This
->
frame
->
ExtensionBlocks
[
i
].
Function
==
GRAPHICS_EXT_FUNC_CODE
&&
This
->
frame
->
ExtensionBlocks
[
i
].
ByteCount
==
4
)
return
This
->
frame
->
ExtensionBlocks
[
i
].
Bytes
;
if
(
This
->
frame
->
Extension
s
.
Extension
Blocks
[
i
].
Function
==
GRAPHICS_EXT_FUNC_CODE
&&
This
->
frame
->
Extension
s
.
Extension
Blocks
[
i
].
ByteCount
==
4
)
return
This
->
frame
->
Extension
s
.
Extension
Blocks
[
i
].
Bytes
;
}
return
NULL
;
}
...
...
dlls/windowscodecs/ungif.c
View file @
629e7f44
...
...
@@ -191,7 +191,7 @@ FreeMapObject(ColorMapObject * Object) {
}
static
int
AddExtensionBlock
(
SavedImage
*
New
,
AddExtensionBlock
(
Extensions
*
New
,
int
Len
,
const
unsigned
char
ExtData
[])
{
...
...
@@ -223,18 +223,18 @@ AddExtensionBlock(SavedImage * New,
}
static
void
FreeExtension
(
SavedImage
*
Image
)
FreeExtension
(
Extensions
*
Extensions
)
{
ExtensionBlock
*
ep
;
if
((
Image
==
NULL
)
||
(
Image
->
ExtensionBlocks
==
NULL
))
{
if
((
Extensions
==
NULL
)
||
(
Extensions
->
ExtensionBlocks
==
NULL
))
{
return
;
}
for
(
ep
=
Image
->
ExtensionBlocks
;
ep
<
(
Image
->
ExtensionBlocks
+
Image
->
ExtensionBlockCount
);
ep
++
)
for
(
ep
=
Extensions
->
ExtensionBlocks
;
ep
<
(
Extensions
->
ExtensionBlocks
+
Extensions
->
ExtensionBlockCount
);
ep
++
)
ungif_free
(
ep
->
Bytes
);
ungif_free
(
Image
->
ExtensionBlocks
);
Image
->
ExtensionBlocks
=
NULL
;
ungif_free
(
Extensions
->
ExtensionBlocks
);
Extensions
->
ExtensionBlocks
=
NULL
;
}
/******************************************************************************
...
...
@@ -258,8 +258,8 @@ FreeSavedImages(GifFileType * GifFile) {
ungif_free
(
sp
->
RasterBits
);
if
(
sp
->
ExtensionBlocks
)
FreeExtension
(
sp
);
if
(
sp
->
Extension
s
.
Extension
Blocks
)
FreeExtension
(
&
sp
->
Extensions
);
}
ungif_free
(
GifFile
->
SavedImages
);
GifFile
->
SavedImages
=
NULL
;
...
...
@@ -424,8 +424,8 @@ DGifGetImageDesc(GifFileType * GifFile) {
sp
->
ImageDesc
.
ColorMap
->
SortFlag
=
GifFile
->
Image
.
ColorMap
->
SortFlag
;
}
sp
->
RasterBits
=
NULL
;
sp
->
ExtensionBlockCount
=
0
;
sp
->
ExtensionBlocks
=
NULL
;
sp
->
Extension
s
.
Extension
BlockCount
=
0
;
sp
->
Extension
s
.
Extension
Blocks
=
NULL
;
GifFile
->
ImageCount
++
;
...
...
@@ -845,7 +845,7 @@ DGifSlurp(GifFileType * GifFile) {
GifRecordType
RecordType
;
SavedImage
*
sp
;
GifByteType
*
ExtData
;
SavedImage
temp_save
;
Extensions
temp_save
;
temp_save
.
ExtensionBlocks
=
NULL
;
temp_save
.
ExtensionBlockCount
=
0
;
...
...
@@ -870,8 +870,8 @@ DGifSlurp(GifFileType * GifFile) {
GIF_ERROR
)
return
(
GIF_ERROR
);
if
(
temp_save
.
ExtensionBlocks
)
{
sp
->
ExtensionBlocks
=
temp_save
.
ExtensionBlocks
;
sp
->
ExtensionBlockCount
=
temp_save
.
ExtensionBlockCount
;
sp
->
Extension
s
.
Extension
Blocks
=
temp_save
.
ExtensionBlocks
;
sp
->
Extension
s
.
Extension
BlockCount
=
temp_save
.
ExtensionBlockCount
;
temp_save
.
ExtensionBlocks
=
NULL
;
temp_save
.
ExtensionBlockCount
=
0
;
...
...
@@ -879,7 +879,7 @@ DGifSlurp(GifFileType * GifFile) {
/* FIXME: The following is wrong. It is left in only for
* backwards compatibility. Someday it should go away. Use
* the sp->ExtensionBlocks->Function variable instead. */
sp
->
Function
=
sp
->
ExtensionBlocks
[
0
].
Function
;
sp
->
Extensions
.
Function
=
sp
->
Extensions
.
ExtensionBlocks
[
0
].
Function
;
}
break
;
...
...
dlls/windowscodecs/ungif.h
View file @
629e7f44
...
...
@@ -98,6 +98,19 @@ typedef struct GifImageDesc {
ColorMapObject
*
ColorMap
;
/* The local color map */
}
GifImageDesc
;
/* This is the in-core version of an extension record */
typedef
struct
{
int
Function
;
/* Holds the type of the Extension block. */
int
ByteCount
;
char
*
Bytes
;
}
ExtensionBlock
;
typedef
struct
{
int
Function
;
/* DEPRECATED: Use ExtensionBlocks[x].Function instead */
int
ExtensionBlockCount
;
ExtensionBlock
*
ExtensionBlocks
;
}
Extensions
;
typedef
struct
GifFileType
{
GifWord
SWidth
,
SHeight
,
/* Screen dimensions. */
SColorResolution
,
/* How many colors can we generate? */
...
...
@@ -152,20 +165,11 @@ int DGifCloseFile(GifFileType * GifFile) DECLSPEC_HIDDEN;
* Support for the in-core structures allocation (slurp mode).
*****************************************************************************/
/* This is the in-core version of an extension record */
typedef
struct
{
int
ByteCount
;
char
*
Bytes
;
int
Function
;
/* Holds the type of the Extension block. */
}
ExtensionBlock
;
/* This holds an image header, its unpacked raster bits, and extensions */
typedef
struct
SavedImage
{
GifImageDesc
ImageDesc
;
unsigned
char
*
RasterBits
;
int
Function
;
/* DEPRECATED: Use ExtensionBlocks[x].Function instead */
int
ExtensionBlockCount
;
ExtensionBlock
*
ExtensionBlocks
;
Extensions
Extensions
;
}
SavedImage
;
#endif
/* _UNGIF_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment