Different solution than the one suggested in http://code.google.com/p/webrtc/issues/detail?id=56 however, should solve the same problem.
Review URL: http://webrtc-codereview.appspot.com/126003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@427 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
87c9b74b11
commit
9aa9996a19
@ -10,6 +10,7 @@
|
||||
|
||||
#include "avi_file.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -1138,10 +1139,20 @@ size_t AviFile::PutBufferZ(const char* str)
|
||||
long AviFile::PutLE32LengthFromCurrent(long startPos)
|
||||
{
|
||||
const long endPos = ftell(_aviFile);
|
||||
WebRtc_Word32 error = fseek(_aviFile, startPos - 4, SEEK_SET);
|
||||
bool success = (0 == fseek(_aviFile, startPos - 4, SEEK_SET));
|
||||
if (!success) {
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
const long len = endPos - startPos;
|
||||
PutLE32(len);
|
||||
error = fseek(_aviFile, endPos, SEEK_SET);
|
||||
if (endPos > startPos) {
|
||||
PutLE32(len);
|
||||
}
|
||||
else {
|
||||
assert(false);
|
||||
}
|
||||
success = (0 == fseek(_aviFile, endPos, SEEK_SET));
|
||||
assert(success);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user