Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
629e7f44
Commit
629e7f44
authored
12 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
windowscodecs: Store GIF frame extensions in a dedicated Extensions structure.
parent
8e87b923
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/windowscodecs/gifformat.c
+6
-6
6 additions, 6 deletions
dlls/windowscodecs/gifformat.c
dlls/windowscodecs/ungif.c
+15
-15
15 additions, 15 deletions
dlls/windowscodecs/ungif.c
dlls/windowscodecs/ungif.h
+14
-10
14 additions, 10 deletions
dlls/windowscodecs/ungif.h
with
35 additions
and
31 deletions
dlls/windowscodecs/gifformat.c
+
6
−
6
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
->
Extensions
.
ExtensionBlockCount
;
++
i
)
{
eb
=
This
->
frame
->
Extensions
.
ExtensionBlocks
+
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
->
Extensions
.
ExtensionBlockCount
;
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
->
Extensions
.
ExtensionBlocks
[
i
].
Function
==
GRAPHICS_EXT_FUNC_CODE
&&
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
ByteCount
==
4
)
return
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
Bytes
;
}
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/windowscodecs/ungif.c
+
15
−
15
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
->
Extensions
.
ExtensionBlocks
)
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
->
Extensions
.
ExtensionBlockCount
=
0
;
sp
->
Extensions
.
ExtensionBlocks
=
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
->
Extensions
.
ExtensionBlocks
=
temp_save
.
ExtensionBlocks
;
sp
->
Extensions
.
ExtensionBlockCount
=
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/windowscodecs/ungif.h
+
14
−
10
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_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment