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
9e6c4f8d
Commit
9e6c4f8d
authored
Sep 04, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/bzip2: throw on unexpected input EOF
Don't silently return 0 when there is no more data, because this may crash the caller. And flush output even if input EOF has been reached.
parent
41b47f95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
NEWS
NEWS
+2
-0
Bzip2ArchivePlugin.cxx
src/archive/plugins/Bzip2ArchivePlugin.cxx
+4
-2
No files found.
NEWS
View file @
9e6c4f8d
...
...
@@ -3,6 +3,8 @@ ver 0.21.26 (not yet released)
- osx: fix crash bug
- sles: support floating point samples
* archive
- bzip2: fix crash on corrupt bzip2 file
- bzip2: flush output at end of input file
- zzip: fix crash on corrupt ZIP file
* decoder
- sndfile: fix lost samples at end of file
...
...
src/archive/plugins/Bzip2ArchivePlugin.cxx
View file @
9e6c4f8d
...
...
@@ -148,8 +148,7 @@ Bzip2InputStream::Read(void *ptr, size_t length)
bzstream
.
avail_out
=
length
;
do
{
if
(
!
FillBuffer
())
return
0
;
const
bool
had_input
=
FillBuffer
();
bz_result
=
BZ2_bzDecompress
(
&
bzstream
);
...
...
@@ -160,6 +159,9 @@ Bzip2InputStream::Read(void *ptr, size_t length)
if
(
bz_result
!=
BZ_OK
)
throw
std
::
runtime_error
(
"BZ2_bzDecompress() has failed"
);
if
(
!
had_input
&&
bzstream
.
avail_out
==
length
)
throw
std
::
runtime_error
(
"Unexpected end of bzip2 file"
);
}
while
(
bzstream
.
avail_out
==
length
);
nbytes
=
length
-
bzstream
.
avail_out
;
...
...
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