Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8759bc1b
Commit
8759bc1b
authored
Jul 09, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/dsdlib: pass unsigned offsets to dsdlib_skip*()
parent
56504534
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
DsdLib.cxx
src/decoder/plugins/DsdLib.cxx
+7
-9
DsdLib.hxx
src/decoder/plugins/DsdLib.hxx
+2
-2
No files found.
src/decoder/plugins/DsdLib.cxx
View file @
8759bc1b
...
...
@@ -58,18 +58,18 @@ dsdlib_read(Decoder *decoder, InputStream &is,
*/
bool
dsdlib_skip_to
(
Decoder
*
decoder
,
InputStream
&
is
,
int64_t
offset
)
u
int64_t
offset
)
{
if
(
is
.
IsSeekable
())
return
is
.
Seek
(
offset
,
IgnoreError
());
if
(
is
.
GetOffset
(
)
>
offset
)
if
(
uint64_t
(
is
.
GetOffset
()
)
>
offset
)
return
false
;
char
buffer
[
8192
];
while
(
is
.
GetOffset
(
)
<
offset
)
{
while
(
uint64_t
(
is
.
GetOffset
()
)
<
offset
)
{
size_t
length
=
sizeof
(
buffer
);
if
(
offset
-
is
.
GetOffset
()
<
(
int64_t
)
length
)
if
(
offset
-
is
.
GetOffset
()
<
(
u
int64_t
)
length
)
length
=
offset
-
is
.
GetOffset
();
size_t
nbytes
=
decoder_read
(
decoder
,
is
,
buffer
,
length
);
...
...
@@ -77,7 +77,7 @@ dsdlib_skip_to(Decoder *decoder, InputStream &is,
return
false
;
}
assert
(
is
.
GetOffset
(
)
==
offset
);
assert
(
uint64_t
(
is
.
GetOffset
()
)
==
offset
);
return
true
;
}
...
...
@@ -86,10 +86,8 @@ dsdlib_skip_to(Decoder *decoder, InputStream &is,
*/
bool
dsdlib_skip
(
Decoder
*
decoder
,
InputStream
&
is
,
int64_t
delta
)
u
int64_t
delta
)
{
assert
(
delta
>=
0
);
if
(
delta
==
0
)
return
true
;
...
...
@@ -99,7 +97,7 @@ dsdlib_skip(Decoder *decoder, InputStream &is,
char
buffer
[
8192
];
while
(
delta
>
0
)
{
size_t
length
=
sizeof
(
buffer
);
if
((
int64_t
)
length
>
delta
)
if
((
u
int64_t
)
length
>
delta
)
length
=
delta
;
size_t
nbytes
=
decoder_read
(
decoder
,
is
,
buffer
,
length
);
...
...
src/decoder/plugins/DsdLib.hxx
View file @
8759bc1b
...
...
@@ -64,11 +64,11 @@ dsdlib_read(Decoder *decoder, InputStream &is,
bool
dsdlib_skip_to
(
Decoder
*
decoder
,
InputStream
&
is
,
int64_t
offset
);
u
int64_t
offset
);
bool
dsdlib_skip
(
Decoder
*
decoder
,
InputStream
&
is
,
int64_t
delta
);
u
int64_t
delta
);
/**
* Add tags from ID3 tag. All tags commonly found in the ID3 tags of
...
...
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