Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Vorbis tools
Commits
18e23df4
Commit
18e23df4
authored
Feb 23, 2008
by
ivo
Browse files
Fix potential problem where int and long might be mixed unnecessarily.
svn path=/trunk/vorbis-tools/; revision=14539
parent
64e7841e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ogginfo/theora.c
View file @
18e23df4
...
...
@@ -117,9 +117,9 @@ void theora_comment_clear(theora_comment *tc){
static
int
_theora_unpack_comment
(
theora_comment
*
tc
,
oggpack_buffer
*
opb
){
int
i
;
int
len
;
long
len
;
_tp_readlsbint
(
opb
,
(
long
*
)
&
len
);
_tp_readlsbint
(
opb
,
&
len
);
if
(
len
<
0
)
return
(
OC_BADHEADER
);
tc
->
vendor
=
_ogg_calloc
(
1
,
len
+
1
);
_tp_readbuffer
(
opb
,
tc
->
vendor
,
len
);
...
...
@@ -130,7 +130,7 @@ static int _theora_unpack_comment(theora_comment *tc, oggpack_buffer *opb){
tc
->
user_comments
=
_ogg_calloc
(
tc
->
comments
,
sizeof
(
*
tc
->
user_comments
));
tc
->
comment_lengths
=
_ogg_calloc
(
tc
->
comments
,
sizeof
(
*
tc
->
comment_lengths
));
for
(
i
=
0
;
i
<
tc
->
comments
;
i
++
){
_tp_readlsbint
(
opb
,
(
long
*
)
&
len
);
_tp_readlsbint
(
opb
,
&
len
);
if
(
len
<
0
)
goto
parse_err
;
tc
->
user_comments
[
i
]
=
_ogg_calloc
(
1
,
len
+
1
);
_tp_readbuffer
(
opb
,
tc
->
user_comments
[
i
],
len
);
...
...
@@ -152,15 +152,15 @@ static int _theora_unpack_tables(theora_info *c, oggpack_buffer *opb){
int
theora_decode_header
(
theora_info
*
ci
,
theora_comment
*
cc
,
ogg_packet
*
op
){
long
ret
;
oggpack_buffer
*
opb
;
if
(
!
op
)
return
OC_BADHEADER
;
opb
=
_ogg_malloc
(
sizeof
(
oggpack_buffer
));
oggpackB_readinit
(
opb
,
op
->
packet
,
op
->
bytes
);
{
char
id
[
6
];
int
typeflag
;
theora_read
(
opb
,
8
,
&
ret
);
typeflag
=
ret
;
if
(
!
(
typeflag
&
0x80
))
{
...
...
@@ -212,7 +212,7 @@ int theora_decode_header(theora_info *ci, theora_comment *cc, ogg_packet *op){
ret
=
_theora_unpack_tables
(
ci
,
opb
);
free
(
opb
);
return
(
ret
);
default:
free
(
opb
);
/* ignore any trailing header packets for forward compatibility */
...
...
@@ -223,4 +223,3 @@ int theora_decode_header(theora_info *ci, theora_comment *cc, ogg_packet *op){
free
(
opb
);
return
(
OC_BADHEADER
);
}
Write
Preview
Supports
Markdown
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