mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
Sync with ogmtools' avilib. Endian fixes.
This commit is contained in:
parent
67c9526bcc
commit
571b95d294
@ -39,7 +39,6 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#if defined(SYS_UNIX) || defined(COMP_MSC) || defined(__APPLE__)
|
||||
typedef off_t off64_t;
|
||||
#define lseek64 lseek
|
||||
#endif
|
||||
|
||||
|
@ -1815,9 +1815,11 @@ int avi_parse_input_file(avi_t *AVI, int getIndex)
|
||||
alBITMAPINFOHEADER bih;
|
||||
|
||||
memcpy(&bih, hdrl_data + i, sizeof(alBITMAPINFOHEADER));
|
||||
AVI->bitmap_info_header = (alBITMAPINFOHEADER *)malloc(bih.bi_size);
|
||||
AVI->bitmap_info_header = (alBITMAPINFOHEADER *)
|
||||
malloc(str2ulong((unsigned char *)&bih.bi_size));
|
||||
if (AVI->bitmap_info_header != NULL)
|
||||
memcpy(AVI->bitmap_info_header, hdrl_data + i, bih.bi_size);
|
||||
memcpy(AVI->bitmap_info_header, hdrl_data + i,
|
||||
str2ulong((unsigned char *)&bih.bi_size));
|
||||
|
||||
AVI->width = str2ulong(hdrl_data+i+4);
|
||||
AVI->height = str2ulong(hdrl_data+i+8);
|
||||
@ -1843,16 +1845,18 @@ int avi_parse_input_file(avi_t *AVI, int getIndex)
|
||||
if (wfe != NULL) {
|
||||
memset(wfe, 0, sizeof(alWAVEFORMATEX));
|
||||
memcpy(wfe, hdrl_data + i, wfes);
|
||||
if (wfe->cb_size != 0) {
|
||||
nwfe = (char *)realloc(wfe, sizeof(alWAVEFORMATEX) +
|
||||
wfe->cb_size);
|
||||
if (str2ushort((unsigned char *)&wfe->cb_size) != 0) {
|
||||
nwfe = (char *)
|
||||
realloc(wfe, sizeof(alWAVEFORMATEX) +
|
||||
str2ushort((unsigned char *)&wfe->cb_size));
|
||||
if (nwfe != 0) {
|
||||
off_t lpos = lseek(AVI->fdes, 0, SEEK_CUR);
|
||||
lseek(AVI->fdes, header_offset + i + sizeof(alWAVEFORMATEX),
|
||||
SEEK_SET);
|
||||
wfe = (alWAVEFORMATEX *)nwfe;
|
||||
nwfe = &nwfe[sizeof(alWAVEFORMATEX)];
|
||||
avi_read(AVI->fdes, nwfe, wfe->cb_size);
|
||||
avi_read(AVI->fdes, nwfe,
|
||||
str2ushort((unsigned char *)&wfe->cb_size));
|
||||
lseek(AVI->fdes, lpos, SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user