Commit 89a2eab3 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

avifil32: Pass the number of characters to LoadStringW, not the number of bytes.

parent 94fe6693
......@@ -1656,7 +1656,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
This->fInfo.dwWidth = MainAVIHdr.dwWidth;
This->fInfo.dwHeight = MainAVIHdr.dwHeight;
LoadStringW(AVIFILE_hModule, IDS_AVIFILETYPE, This->fInfo.szFileType,
sizeof(This->fInfo.szFileType));
sizeof(This->fInfo.szFileType)/sizeof(This->fInfo.szFileType[0]));
/* go back to into header list */
if (mmioAscend(This->hmmio, &ck, 0) != S_OK)
......@@ -1767,9 +1767,9 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
/* generate description for stream like "filename.avi Type #n" */
if (streamHdr.fccType == streamtypeVIDEO)
LoadStringW(AVIFILE_hModule, IDS_VIDEO, szType, sizeof(szType));
LoadStringW(AVIFILE_hModule, IDS_VIDEO, szType, sizeof(szType)/sizeof(szType[0]));
else if (streamHdr.fccType == streamtypeAUDIO)
LoadStringW(AVIFILE_hModule, IDS_AUDIO, szType, sizeof(szType));
LoadStringW(AVIFILE_hModule, IDS_AUDIO, szType, sizeof(szType)/sizeof(szType[0]));
else
wsprintfW(szType, streamTypeFmt, (char*)&streamHdr.fccType);
......@@ -1782,7 +1782,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
memset(pStream->sInfo.szName, 0, sizeof(pStream->sInfo.szName));
LoadStringW(AVIFILE_hModule, IDS_AVISTREAMFORMAT, streamNameFmt, sizeof(streamNameFmt));
LoadStringW(AVIFILE_hModule, IDS_AVISTREAMFORMAT, streamNameFmt, sizeof(streamNameFmt)/sizeof(streamNameFmt[0]));
/* FIXME: avoid overflow -- better use wsnprintfW, which doesn't exists ! */
wsprintfW(pStream->sInfo.szName, streamNameFmt,
......
......@@ -607,9 +607,9 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
memset(& This->sInfo, 0, sizeof(This->sInfo));
LoadStringW(AVIFILE_hModule, IDS_WAVEFILETYPE, This->fInfo.szFileType,
sizeof(This->fInfo.szFileType));
sizeof(This->fInfo.szFileType)/sizeof(This->fInfo.szFileType[0]));
if (LoadStringW(AVIFILE_hModule, IDS_WAVESTREAMFORMAT,
wszStreamFmt, sizeof(wszStreamFmt)) > 0) {
wszStreamFmt, sizeof(wszStreamFmt)/sizeof(wszStreamFmt[0])) > 0) {
wsprintfW(This->sInfo.szName, wszStreamFmt,
AVIFILE_BasenameW(This->szFileName));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment