| Summary: | SIGSEGV in libakode when reading mmapped files | ||
|---|---|---|---|
| Product: | [Unmaintained] akodelib | Reporter: | Julio <juliolopez> |
| Component: | general | Assignee: | Allan Sandfeld <kde> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Julio
2004-11-16 02:11:02 UTC
CVS commit by carewolf:
Backport mmap crash-fix
CCBUG: 93343
M +1 -0 mmapfile.cpp 1.9.2.2
--- kdemultimedia/akode/lib/mmapfile.cpp #1.9.2.1:1.9.2.2
@@ -66,4 +66,5 @@ bool MMapFile::openRO() {
if (handle == MAP_FAILED) {
::close(fd);
+ handle = 0;
return false;
}
CVS commit by carewolf:
Test if the file can be opened, if not fall back to non-mapped files, then fail.
Thanks to Julio for the _perfect_ bug-report :)
BUG: 93343
M +11 -1 akodePlayObject_impl.cpp 1.26
--- kdemultimedia/akode/arts_plugin/akodePlayObject_impl.cpp #1.25:1.26
@@ -35,5 +35,5 @@
#include "audioframe.h"
-//#include "localfile.h"
+#include "localfile.h"
#include "mmapfile.h"
#include "framedecoder.h"
@@ -112,4 +112,14 @@ bool akodePlayObject_impl::loadMedia(con
arts_debug("akode: opening %s", filename.c_str());
source = new MMapFile(filename.c_str());
+ if (!source->openRO()) {
+ delete source;
+ source = new LocalFile(filename.c_str());
+ if (!source->openRO()) {
+ delete source;
+ source = 0;
+ return false;
+ }
+ }
+ source->close();
return loadSource();
}
|