[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10044: Another small cleanup and si
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10044: Another small cleanup and simple corruption notification. |
Date: |
Wed, 22 Oct 2008 01:56:04 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10044
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Wed 2008-10-22 01:56:04 +0200
message:
Another small cleanup and simple corruption notification.
modified:
libmedia/FLVParser.cpp
libmedia/FLVParser.h
=== modified file 'libmedia/FLVParser.cpp'
--- a/libmedia/FLVParser.cpp 2008-10-21 20:20:52 +0000
+++ b/libmedia/FLVParser.cpp 2008-10-21 23:56:04 +0000
@@ -361,7 +361,6 @@
_nextPosToIndex = _lastParsedPosition;
}
-
if ( position > _bytesLoaded ) {
boost::mutex::scoped_lock lock(_bytesLoadedMutex);
_bytesLoaded = _lastParsedPosition;
@@ -446,14 +445,20 @@
return false;
}
+ _stream->read(chunk, 4);
+ boost::uint32_t prevtagsize = chunk[0] << 24 | chunk[1] << 16 |
chunk[2] << 8 | chunk[3];
+ if (prevtagsize != flvtag.body_size + 11) {
+ log_error(_("Corrupt FLV: previous tag record (%1%) unexpected
(actual size: %2%)"),
+ prevtagsize, flvtag.body_size + 11);
+ }
+
return true;
}
// would be called by MAIN thread
bool FLVParser::parseHeader()
{
- // seek to the begining of the file
- _stream->seek(0); // seek back ? really ?
+ assert(_stream->tell() == 0);
// We only use 5 bytes of the header, because the last 4 bytes represent
// an integer which is always 1.
=== modified file 'libmedia/FLVParser.h'
--- a/libmedia/FLVParser.h 2008-10-21 20:20:52 +0000
+++ b/libmedia/FLVParser.h 2008-10-21 23:56:04 +0000
@@ -73,7 +73,7 @@
class DSOEXPORT FLVParser : public MediaParser
{
-public:
+private:
enum tagType
{
@@ -135,7 +135,7 @@
boost::uint8_t codec;
};
-
+public:
/// \brief
/// Create an FLV parser reading input from
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10044: Another small cleanup and simple corruption notification.,
Bastiaan Jacques <=