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
acfba023
Commit
acfba023
authored
Nov 15, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: check length==0 in decoder_read()
When the caller passes length==0, decoder_read() entered an endless loop. Check that condition before entering the "while" loop.
parent
c368a2f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
decoder_api.c
src/decoder_api.c
+3
-0
input_stream.c
src/input_stream.c
+4
-0
No files found.
src/decoder_api.c
View file @
acfba023
...
...
@@ -106,6 +106,9 @@ size_t decoder_read(struct decoder *decoder,
assert
(
is
!=
NULL
);
assert
(
buffer
!=
NULL
);
if
(
length
==
0
)
return
0
;
while
(
true
)
{
/* XXX don't allow decoder==NULL */
if
(
decoder
!=
NULL
&&
...
...
src/input_stream.c
View file @
acfba023
...
...
@@ -26,6 +26,7 @@
#endif
#include <glib.h>
#include <assert.h>
static
const
struct
input_plugin
*
const
input_plugins
[]
=
{
&
input_plugin_file
,
...
...
@@ -84,6 +85,9 @@ input_stream_seek(struct input_stream *is, off_t offset, int whence)
size_t
input_stream_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
)
{
assert
(
ptr
!=
NULL
);
assert
(
size
>
0
);
return
is
->
plugin
->
read
(
is
,
ptr
,
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