Author: akhaldi
Date: Wed Mar 18 15:39:32 2015
New Revision: 66787
URL:
http://svn.reactos.org/svn/reactos?rev=66787&view=rev
Log:
[AVIFIL32] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
trunk/reactos/dll/win32/avifil32/avifile.c
trunk/reactos/dll/win32/avifil32/editstream.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/avifil32/avifile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/avifil32/avifile…
==============================================================================
--- trunk/reactos/dll/win32/avifil32/avifile.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/avifil32/avifile.c [iso-8859-1] Wed Mar 18 15:39:32 2015
@@ -446,13 +446,12 @@
This->ppStreams[nStream] != NULL) {
/* ... so delete it now */
HeapFree(GetProcessHeap(), 0, This->ppStreams[nStream]);
-
- if (This->fInfo.dwStreams - nStream > 0)
- memcpy(This->ppStreams + nStream, This->ppStreams + nStream + 1,
- (This->fInfo.dwStreams - nStream) * sizeof(IAVIStreamImpl*));
+ This->fInfo.dwStreams--;
+ if (nStream < This->fInfo.dwStreams)
+ memmove(&This->ppStreams[nStream], &This->ppStreams[nStream + 1],
+ (This->fInfo.dwStreams - nStream) * sizeof(This->ppStreams[0]));
This->ppStreams[This->fInfo.dwStreams] = NULL;
- This->fInfo.dwStreams--;
This->fDirty = TRUE;
/* This->fInfo will be updated further when asked for */
@@ -1406,11 +1405,21 @@
/* pre-conditions */
assert(This != NULL && This->ppStreams[0] != NULL);
- if (This->idxRecords == NULL || This->cbIdxRecords == 0) {
- This->cbIdxRecords += 1024 * sizeof(AVIINDEXENTRY);
- This->idxRecords = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
This->cbIdxRecords);
- if (This->idxRecords == NULL)
+ if (This->idxRecords == NULL || This->cbIdxRecords / sizeof(AVIINDEXENTRY) <=
This->nIdxRecords) {
+ DWORD new_count = This->cbIdxRecords + 1024 * sizeof(AVIINDEXENTRY);
+ void *mem;
+ if (!This->idxRecords)
+ mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, new_count);
+ else
+ mem = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->idxRecords,
new_count);
+ if (mem) {
+ This->cbIdxRecords = new_count;
+ This->idxRecords = mem;
+ } else {
+ HeapFree(GetProcessHeap(), 0, This->idxRecords);
+ This->idxRecords = NULL;
return AVIERR_MEMORY;
+ }
}
assert(This->nIdxRecords < This->cbIdxRecords/sizeof(AVIINDEXENTRY));
@@ -1442,7 +1451,7 @@
dwPos += ((pStream->cbFormat + 1) & ~1U);
if (pStream->lpHandlerData != NULL && pStream->cbHandlerData > 0)
dwPos += 2 * sizeof(DWORD) + ((pStream->cbHandlerData + 1) & ~1U);
- if (lstrlenW(pStream->sInfo.szName) > 0)
+ if (pStream->sInfo.szName[0])
dwPos += 2 * sizeof(DWORD) + ((lstrlenW(pStream->sInfo.szName) + 1) & ~1U);
}
@@ -2201,7 +2210,7 @@
}
/* ... an optional name for this stream ... */
- if (lstrlenW(pStream->sInfo.szName) > 0) {
+ if (pStream->sInfo.szName[0]) {
LPSTR str;
ck.ckid = ckidSTREAMNAME;
Modified: trunk/reactos/dll/win32/avifil32/editstream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/avifil32/editstr…
==============================================================================
--- trunk/reactos/dll/win32/avifil32/editstream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/avifil32/editstream.c [iso-8859-1] Wed Mar 18 15:39:32 2015
@@ -152,10 +152,9 @@
/* remove part nr */
IAVIStream_Release(This->pStreams[nr].pStream);
This->nStreams--;
- if (This->nStreams - nr > 0) {
- memmove(This->pStreams + nr, This->pStreams + nr + 1,
- (This->nStreams - nr) * sizeof(EditStreamTable));
- }
+ if (nr < This->nStreams)
+ memmove(&This->pStreams[nr], &This->pStreams[nr + 1],
+ (This->nStreams - nr) * sizeof(This->pStreams[0]));
This->pStreams[This->nStreams].pStream = NULL;
This->pStreams[This->nStreams].dwStart = 0;
This->pStreams[This->nStreams].dwLength = 0;
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Mar 18 15:39:32 2015
@@ -55,7 +55,7 @@
reactos/dll/win32/atl # Synced to WineStaging-1.7.37
reactos/dll/win32/atl80 # Synced to WineStaging-1.7.37
reactos/dll/win32/atl100 # Synced to WineStaging-1.7.37
-reactos/dll/win32/avifil32 # Synced to Wine-1.7.27
+reactos/dll/win32/avifil32 # Synced to WineStaging-1.7.37
reactos/dll/win32/bcrypt # Synced to Wine-1.7.27
reactos/dll/win32/browseui # Out of sync
reactos/dll/win32/cabinet # Synced to Wine-1.7.27