Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
liboggz
Commits
822b0af6
Commit
822b0af6
authored
Aug 12, 2009
by
conrad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mozilla #506878: check oggz_stream_get_content() return values
parent
0997b434
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
src/liboggz/oggz_read.c
src/liboggz/oggz_read.c
+25
-23
No files found.
src/liboggz/oggz_read.c
View file @
822b0af6
...
...
@@ -256,6 +256,12 @@ oggz_read_update_gp(void *elem) {
if
(
p
->
calced_granulepos
==
-
1
&&
p
->
stream
->
last_granulepos
!=
-
1
)
{
int
content
=
oggz_stream_get_content
(
p
->
oggz
,
p
->
serialno
);
/* Cancel the iteration (backwards through buffered packets)
* if we don't know the codec */
if
(
content
<
0
||
content
>=
OGGZ_CONTENT_UNKNOWN
)
return
DLIST_ITER_CANCEL
;
p
->
calced_granulepos
=
oggz_auto_calculate_gp_backwards
(
content
,
p
->
stream
->
last_granulepos
,
p
->
stream
,
&
(
p
->
packet
),
p
->
stream
->
last_packet
);
...
...
@@ -384,32 +390,28 @@ oggz_read_sync (OGGZ * oggz)
granulepos
=
op
->
granulepos
;
content
=
oggz_stream_get_content
(
oggz
,
serialno
);
/*
* if we have no metrics for this stream yet, then generate them
*/
if
(
(
!
stream
->
metric
||
(
content
==
OGGZ_CONTENT_SKELETON
))
&&
(
oggz
->
flags
&
OGGZ_AUTO
)
)
{
oggz_auto_read_bos_packet
(
oggz
,
op
,
serialno
,
NULL
);
}
if
(
content
<
0
||
content
>=
OGGZ_CONTENT_UNKNOWN
)
{
reader
->
current_granulepos
=
granulepos
;
}
else
{
/* if we have no metrics for this stream yet, then generate them */
if
((
!
stream
->
metric
||
content
==
OGGZ_CONTENT_SKELETON
)
&&
(
oggz
->
flags
&
OGGZ_AUTO
))
{
oggz_auto_read_bos_packet
(
oggz
,
op
,
serialno
,
NULL
);
}
/* attempt to determine granulepos for this packet */
if
(
oggz
->
flags
&
OGGZ_AUTO
)
{
reader
->
current_granulepos
=
oggz_auto_calculate_granulepos
(
content
,
granulepos
,
stream
,
op
);
/* make sure that we accept any "real" gaps in the granulepos
*/
if
(
granulepos
!=
-
1
&&
reader
->
current_granulepos
<
granulepos
)
{
/* attempt to determine granulepos for this packet */
if
(
oggz
->
flags
&
OGGZ_AUTO
)
{
reader
->
current_granulepos
=
oggz_auto_calculate_granulepos
(
content
,
granulepos
,
stream
,
op
);
/* make sure that we accept any "real" gaps in the granulepos */
if
(
granulepos
!=
-
1
&&
reader
->
current_granulepos
<
granulepos
)
{
reader
->
current_granulepos
=
granulepos
;
}
}
else
{
reader
->
current_granulepos
=
granulepos
;
}
}
else
{
reader
->
current_granulepos
=
granulepos
;
}
}
stream
->
last_granulepos
=
reader
->
current_granulepos
;
/* set unit on last packet of page */
...
...
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