[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp |
Date: |
Wed, 23 May 2007 20:31:08 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Bastiaan Jacques <bjacques> 07/05/23 20:31:08
Modified files:
. : ChangeLog
libbase : FLVParser.cpp
Log message:
Fix more memory bugs by adding padding
zero bytes. Should fix bug #19898.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3325&r2=1.3326
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/FLVParser.cpp?cvsroot=gnash&r1=1.13&r2=1.14
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3325
retrieving revision 1.3326
diff -u -b -r1.3325 -r1.3326
--- ChangeLog 23 May 2007 20:06:19 -0000 1.3325
+++ ChangeLog 23 May 2007 20:31:07 -0000 1.3326
@@ -64,6 +64,8 @@
is not the first window to receive key notifications.
* macros/gnashpkgtool.m4: Don't forget to set the "found" flag
for CFLAGS when --with-pkg-incl is used to find the include path.
+ * libbase/FLVParser.cpp: Fix more memory bugs by adding padding
+ zero bytes. Should fix bug #19898.
2007-05-23 Tomas Groth Christensen <address@hidden>
Index: libbase/FLVParser.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/FLVParser.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libbase/FLVParser.cpp 23 May 2007 07:42:16 -0000 1.13
+++ libbase/FLVParser.cpp 23 May 2007 20:31:07 -0000 1.14
@@ -17,12 +17,15 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-// $Id: FLVParser.cpp,v 1.13 2007/05/23 07:42:16 tgc Exp $
+// $Id: FLVParser.cpp,v 1.14 2007/05/23 20:31:07 bjacques Exp $
#include "FLVParser.h"
#include "amf.h"
#include "log.h"
+#define PADDING_BYTES 8
+
+
FLVParser::FLVParser()
:
_lt(NULL),
@@ -147,7 +150,6 @@
}
// Find the next frame in the file a return it
-#define PADDING_BYTES 8
if (useAudio) {
@@ -179,7 +181,6 @@
return frame;
}
-#undef PADDING_BYTES
}
@@ -204,8 +205,11 @@
frame->tag = 8;
_lt->seek(_audioFrames[_nextAudioFrame]->dataPosition);
- frame->data = new uint8_t[_audioFrames[_nextAudioFrame]->dataSize];
- _lt->read(frame->data, _audioFrames[_nextAudioFrame]->dataSize);
+ frame->data = new uint8_t[_audioFrames[_nextAudioFrame]->dataSize +
+ PADDING_BYTES];
+ size_t bytesread = _lt->read(frame->data,
+ _audioFrames[_nextAudioFrame]->dataSize);
+ memset(frame->data + bytesread, 0, PADDING_BYTES);
_nextAudioFrame++;
return frame;
@@ -236,18 +240,21 @@
return NULL;
}
+
FLVFrame* frame = new FLVFrame;
frame->dataSize = _videoFrames[_nextVideoFrame]->dataSize;
frame->timestamp = _videoFrames[_nextVideoFrame]->timestamp;
frame->tag = 9;
_lt->seek(_videoFrames[_nextVideoFrame]->dataPosition);
- frame->data = new uint8_t[_videoFrames[_nextVideoFrame]->dataSize];
- _lt->read(frame->data, _videoFrames[_nextVideoFrame]->dataSize);
+ frame->data = new uint8_t[_videoFrames[_nextVideoFrame]->dataSize +
+ PADDING_BYTES];
+ size_t bytesread = _lt->read(frame->data,
+ _videoFrames[_nextVideoFrame]->dataSize);
+ memset(frame->data + bytesread, 0, PADDING_BYTES);
_nextVideoFrame++;
return frame;
-
}
@@ -657,3 +664,5 @@
{
_lt = lt;
}
+
+#undef PADDING_BYTES