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
a6839c4e
Commit
a6839c4e
authored
Jan 09, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmpdec: support for rgb444 with bitfields compression
Do not display garbage for invalid/unsupported bitfields values.
parent
93d49cba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
bmp.c
libavcodec/bmp.c
+12
-2
No files found.
libavcodec/bmp.c
View file @
a6839c4e
...
...
@@ -163,8 +163,18 @@ static int bmp_decode_frame(AVCodecContext *avctx,
case
16
:
if
(
comp
==
BMP_RGB
)
avctx
->
pix_fmt
=
PIX_FMT_RGB555
;
if
(
comp
==
BMP_BITFIELDS
)
avctx
->
pix_fmt
=
rgb
[
1
]
==
0x07E0
?
PIX_FMT_RGB565
:
PIX_FMT_RGB555
;
else
if
(
comp
==
BMP_BITFIELDS
)
{
if
(
rgb
[
0
]
==
0xF800
&&
rgb
[
1
]
==
0x07E0
&&
rgb
[
2
]
==
0x001F
)
avctx
->
pix_fmt
=
PIX_FMT_RGB565
;
else
if
(
rgb
[
0
]
==
0x7C00
&&
rgb
[
1
]
==
0x03E0
&&
rgb
[
2
]
==
0x001F
)
avctx
->
pix_fmt
=
PIX_FMT_RGB555
;
else
if
(
rgb
[
0
]
==
0x0F00
&&
rgb
[
1
]
==
0x00F0
&&
rgb
[
2
]
==
0x000F
)
avctx
->
pix_fmt
=
PIX_FMT_RGB444
;
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown bitfields %0X %0X %0X
\n
"
,
rgb
[
0
],
rgb
[
1
],
rgb
[
2
]);
return
AVERROR
(
EINVAL
);
}
}
break
;
case
8
:
if
(
hsize
-
ihsize
-
14
>
0
)
...
...
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