From 804ac7b02ab1965c0a84b991e2d9e77684fae46d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 25 May 2004 12:52:18 +0000 Subject: [PATCH] Create the BITMAPINFOHEADER in an Endian safe way. --- ChangeLog | 4 ++++ src/input/r_ogm.cpp | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 434e8eb21..9ac3efc5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-05-25 Moritz Bunkus + + * mkvmerge: bug fix: The OGM reader was not Endian safe. + 2004-05-20 Moritz Bunkus * mkvmerge: Rewrite of the VobSub handling code. diff --git a/src/input/r_ogm.cpp b/src/input/r_ogm.cpp index 5829ea577..aa35b6aa6 100644 --- a/src/input/r_ogm.cpp +++ b/src/input/r_ogm.cpp @@ -449,13 +449,14 @@ ogm_reader_c::create_packetizer(int64_t tid) { case OGM_STREAM_TYPE_VIDEO: // AVI compatibility mode. Fill in the values we've got and guess // the others. - bih.bi_size = sizeof(alBITMAPINFOHEADER); - bih.bi_width = get_uint32(&sth->sh.video.width); - bih.bi_height = get_uint32(&sth->sh.video.height); - bih.bi_planes = 1; - bih.bi_bit_count = 24; + put_uint32(&bih.bi_size, sizeof(alBITMAPINFOHEADER)); + put_uint32(&bih.bi_width, get_uint32(&sth->sh.video.width)); + put_uint32(&bih.bi_height, get_uint32(&sth->sh.video.height)); + put_uint16(&bih.bi_planes, 1); + put_uint16(&bih.bi_bit_count, 24); memcpy(&bih.bi_compression, sth->subtype, 4); - bih.bi_size_image = bih.bi_width * bih.bi_height * 3; + put_uint32(&bih.bi_size_image, get_uint32(&bih.bi_width) * + get_uint32(&bih.bi_height) * 3); ti->private_data = (unsigned char *)&bih; ti->private_size = sizeof(alBITMAPINFOHEADER);