Removed patch to reallocate buffer when adding records to AVI files (fixed upstream).

This commit is contained in:
Sebastian Lackner
2014-12-31 23:45:20 +01:00
parent 706ff96060
commit b5e303e711
5 changed files with 2 additions and 61 deletions

View File

@@ -24,7 +24,6 @@ PATCHLIST := \
Pipelight.ok \
Staging.ok \
atl-IOCS_Property.ok \
avifil32-Realloc_Records.ok \
comctl32-LoadIconMetric.ok \
configure-Absolute_RPATH.ok \
d3d9-Surface_Refcount.ok \
@@ -288,21 +287,6 @@ atl-IOCS_Property.ok:
echo '+ { "Qian Hong", "atl: Don'\''t use GWLP_USERDATA to store IOCS to avoid conflict with Apps.", 1 },'; \
) > atl-IOCS_Property.ok
# Patchset avifil32-Realloc_Records
# |
# | This patchset fixes the following Wine bugs:
# | * [#5137] Reallocate buffer when adding records to AVI files
# |
# | Modified files:
# | * dlls/avifil32/avifile.c
# |
.INTERMEDIATE: avifil32-Realloc_Records.ok
avifil32-Realloc_Records.ok:
$(call APPLY_FILE,avifil32-Realloc_Records/0001-avifil32-Reallocate-buffer-when-adding-records.patch)
@( \
echo '+ { "Sebastian Lackner", "avifil32: Reallocate buffer when adding records.", 1 },'; \
) > avifil32-Realloc_Records.ok
# Patchset comctl32-LoadIconMetric
# |
# | This patchset fixes the following Wine bugs:

View File

@@ -1,43 +0,0 @@
From a7766bfbb41580091192539432c9372ceaf41c18 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 12 Dec 2014 05:48:59 +0100
Subject: avifil32: Reallocate buffer when adding records.
Based on a patch by Bruno Jesus.
---
dlls/avifil32/avifile.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index af0315d..c7779c5 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -1424,11 +1424,20 @@ static HRESULT AVIFILE_AddRecord(IAVIFileImpl *This)
/* 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)
- return AVIERR_MEMORY;
+ if (This->idxRecords == NULL || This->cbIdxRecords / sizeof(AVIINDEXENTRY) <= This->nIdxRecords) {
+ DWORD new_count = This->cbIdxRecords + 1024 * sizeof(AVIINDEXENTRY);
+ if (!This->idxRecords)
+ {
+ This->idxRecords = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, new_count);
+ if (!This->idxRecords) return AVIERR_MEMORY;
+ }
+ else
+ {
+ void *new_buffer = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->idxRecords, new_count);
+ if (!new_buffer) return AVIERR_MEMORY;
+ This->idxRecords = new_buffer;
+ }
+ This->cbIdxRecords = new_count;
}
assert(This->nIdxRecords < This->cbIdxRecords/sizeof(AVIINDEXENTRY));
--
2.1.3

View File

@@ -1 +0,0 @@
Fixes: [5137] Reallocate buffer when adding records to AVI files