Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
57214b2f
Commit
57214b2f
authored
Jul 20, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dds: Fix palette decoding
Red and blue channels were decoded in the wrong order. Found-By: ami_stuff
parent
ea4d46e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
dds.c
libavcodec/dds.c
+7
-3
dds-pal
tests/ref/fate/dds-pal
+1
-1
dds-pal-ati
tests/ref/fate/dds-pal-ati
+1
-1
No files found.
libavcodec/dds.c
View file @
57214b2f
...
...
@@ -645,11 +645,15 @@ static int dds_decode(AVCodecContext *avctx, void *data,
if
(
ctx
->
paletted
)
{
int
i
;
uint
32_t
*
p
=
(
uint32_t
*
)
frame
->
data
[
1
];
uint
8_t
*
p
=
frame
->
data
[
1
];
/* Use the first 1024 bytes as palette, then copy the rest. */
for
(
i
=
0
;
i
<
256
;
i
++
)
p
[
i
]
=
bytestream2_get_le32
(
gbc
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
p
[
i
*
4
+
2
]
=
bytestream2_get_byte
(
gbc
);
p
[
i
*
4
+
1
]
=
bytestream2_get_byte
(
gbc
);
p
[
i
*
4
+
0
]
=
bytestream2_get_byte
(
gbc
);
p
[
i
*
4
+
3
]
=
bytestream2_get_byte
(
gbc
);
}
frame
->
palette_has_changed
=
1
;
}
...
...
tests/ref/fate/dds-pal
View file @
57214b2f
#tb 0: 1/25
0, 0, 0, 1, 65536, 0x
bffe
e5cd
0, 0, 0, 1, 65536, 0x
4287
e5cd
tests/ref/fate/dds-pal-ati
View file @
57214b2f
#tb 0: 1/25
0, 0, 0, 1, 16384, 0x
2306
8060
0, 0, 0, 1, 16384, 0x
6ac1
8060
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