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
393d5031
Commit
393d5031
authored
Sep 09, 2011
by
Laurent Aimar
Committed by
Alex Converse
Sep 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed size given to init_get_bits() in xan decoder.
parent
826c56d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
xan.c
libavcodec/xan.c
+6
-4
No files found.
libavcodec/xan.c
View file @
393d5031
...
...
@@ -95,17 +95,18 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
return
0
;
}
static
int
xan_huffman_decode
(
unsigned
char
*
dest
,
const
unsigned
char
*
src
,
int
dest
_len
)
static
int
xan_huffman_decode
(
unsigned
char
*
dest
,
int
dest_len
,
const
unsigned
char
*
src
,
int
src
_len
)
{
unsigned
char
byte
=
*
src
++
;
unsigned
char
ival
=
byte
+
0x16
;
const
unsigned
char
*
ptr
=
src
+
byte
*
2
;
int
ptr_len
=
src_len
-
1
-
byte
*
2
;
unsigned
char
val
=
ival
;
unsigned
char
*
dest_end
=
dest
+
dest_len
;
GetBitContext
gb
;
init_get_bits
(
&
gb
,
ptr
,
0
);
// FIXME: no src size available
init_get_bits
(
&
gb
,
ptr
,
ptr_len
*
8
);
while
(
val
!=
0x16
)
{
val
=
src
[
val
-
0x17
+
get_bits1
(
&
gb
)
*
byte
];
...
...
@@ -270,7 +271,8 @@ static void xan_wc3_decode_frame(XanContext *s) {
vector_segment
=
s
->
buf
+
AV_RL16
(
&
s
->
buf
[
4
]);
imagedata_segment
=
s
->
buf
+
AV_RL16
(
&
s
->
buf
[
6
]);
xan_huffman_decode
(
opcode_buffer
,
huffman_segment
,
opcode_buffer_size
);
xan_huffman_decode
(
opcode_buffer
,
opcode_buffer_size
,
huffman_segment
,
s
->
size
-
(
huffman_segment
-
s
->
buf
)
);
if
(
imagedata_segment
[
0
]
==
2
)
xan_unpack
(
s
->
buffer2
,
&
imagedata_segment
[
1
],
s
->
buffer2_size
);
...
...
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