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
a8014534
Commit
a8014534
authored
Mar 07, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g2meet: K&R formatting cosmetics
parent
f87a6e50
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
30 deletions
+41
-30
g2meet.c
libavcodec/g2meet.c
+41
-30
No files found.
libavcodec/g2meet.c
View file @
a8014534
...
...
@@ -379,7 +379,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
src
+=
3
;
}
npal
=
*
src
++
+
1
;
memcpy
(
pal
,
src
,
npal
*
3
);
src
+=
npal
*
3
;
memcpy
(
pal
,
src
,
npal
*
3
);
src
+=
npal
*
3
;
if
(
sub_type
!=
2
)
{
for
(
i
=
0
;
i
<
npal
;
i
++
)
{
if
(
!
memcmp
(
pal
+
i
*
3
,
transp
,
3
))
{
...
...
@@ -391,7 +392,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
if
(
src_end
-
src
<
2
)
return
0
;
zsize
=
(
src
[
0
]
<<
8
)
|
src
[
1
];
src
+=
2
;
zsize
=
(
src
[
0
]
<<
8
)
|
src
[
1
];
src
+=
2
;
if
(
src_end
-
src
<
zsize
)
return
AVERROR_INVALIDDATA
;
...
...
@@ -555,16 +557,22 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
int
mask_bit
=
!!
(
bits
&
0x80000000
);
switch
(
dst
[
0
]
*
2
+
mask_bit
)
{
case
0
:
dst
[
0
]
=
0xFF
;
dst
[
1
]
=
0x00
;
dst
[
2
]
=
0x00
;
dst
[
3
]
=
0x00
;
dst
[
0
]
=
0xFF
;
dst
[
1
]
=
0x00
;
dst
[
2
]
=
0x00
;
dst
[
3
]
=
0x00
;
break
;
case
1
:
dst
[
0
]
=
0xFF
;
dst
[
1
]
=
0xFF
;
dst
[
2
]
=
0xFF
;
dst
[
3
]
=
0xFF
;
dst
[
0
]
=
0xFF
;
dst
[
1
]
=
0xFF
;
dst
[
2
]
=
0xFF
;
dst
[
3
]
=
0xFF
;
break
;
default:
dst
[
0
]
=
0x00
;
dst
[
1
]
=
0x00
;
dst
[
2
]
=
0x00
;
dst
[
3
]
=
0x00
;
dst
[
0
]
=
0x00
;
dst
[
1
]
=
0x00
;
dst
[
2
]
=
0x00
;
dst
[
3
]
=
0x00
;
}
dst
+=
4
;
bits
<<=
1
;
...
...
@@ -730,7 +738,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
c
->
bpp
=
bytestream2_get_byte
(
&
bc
);
if
(
c
->
bpp
==
32
)
{
if
(
bytestream2_get_bytes_left
(
&
bc
)
<
16
||
(
chunk_size
-
21
)
<
16
)
{
(
chunk_size
-
21
)
<
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Display info: missing bitmasks!
\n
"
);
return
AVERROR_INVALIDDATA
;
...
...
@@ -841,15 +849,18 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
return
buf_size
;
header_fail:
c
->
width
=
c
->
height
=
0
;
c
->
tiles_x
=
c
->
tiles_y
=
0
;
c
->
width
=
c
->
height
=
0
;
c
->
tiles_x
=
c
->
tiles_y
=
0
;
return
ret
;
}
static
av_cold
int
g2m_decode_init
(
AVCodecContext
*
avctx
)
{
G2MContext
*
const
c
=
avctx
->
priv_data
;
G2MContext
*
const
c
=
avctx
->
priv_data
;
int
ret
;
if
((
ret
=
jpg_init
(
avctx
,
&
c
->
jc
))
!=
0
)
{
...
...
@@ -865,7 +876,7 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
static
av_cold
int
g2m_decode_end
(
AVCodecContext
*
avctx
)
{
G2MContext
*
const
c
=
avctx
->
priv_data
;
G2MContext
*
const
c
=
avctx
->
priv_data
;
jpg_free_context
(
&
c
->
jc
);
...
...
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