avilib: read all of 'strf' even if biSize does not include it

Fixes #1129.
This commit is contained in:
Mats Peterson 2015-02-25 21:14:33 +01:00 committed by Moritz Bunkus
parent d33adf5ee0
commit e7d8415656
3 changed files with 14 additions and 9 deletions

View File

@ -170,6 +170,7 @@ Peterson, Mats <matsp888@yahoo.com>
* bug fix for the number of bits/pixel in mkvextract for AVI files
* bug fix for writing correct values in the ckSize of 'strf'
chunks in mkvextract for AVI files
* bug fix for reading all of the private data in the 'strf' chunk
Pettenò, Diego <flameeyes@gentoo.org>
* Support for liblzo2

View File

@ -1,5 +1,9 @@
2015-02-25 Mats Peterson <matsp888@yahoo.com>
* mkvmerge: bug fix: Fixed reading all of the private codec data
in AVIs from the 'strf' chunk for codecs that don't set biSize to
include that data. Fixes #1129.
* mkvextract: bug fix: Fixed writing AVIs with ckSize fields that
were too large. Fixes #1128.

View File

@ -2445,15 +2445,15 @@ int avi_parse_input_file(avi_t *AVI, int getIndex)
i += 8;
if(lasttag == 1)
{
alBITMAPINFOHEADER bih;
memcpy(&bih, hdrl_data + i, sizeof(alBITMAPINFOHEADER));
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,
str2ulong((unsigned char *)&bih.bi_size));
uint32_t ck_size = str2ulong(hdrl_data + i - 4);
uint32_t bih_size = str2ulong(hdrl_data + i);
uint32_t bi_size = bih_size > 40 ? bih_size : ck_size;
AVI->bitmap_info_header = (alBITMAPINFOHEADER *)malloc(bi_size);
if (AVI->bitmap_info_header != NULL) {
memcpy(AVI->bitmap_info_header, hdrl_data + i, bi_size);
long2str(&AVI->bitmap_info_header->bi_size, bi_size);
}
AVI->width = str2ulong(hdrl_data+i+4);
AVI->height = str2ulong(hdrl_data+i+8);
vids_strf_seen = 1;