From 461e3ac82b16ac73a3237c15f51b3c57c74a8929 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 27 Feb 2015 21:58:31 +0100 Subject: [PATCH] avilib: only require track ID instead of full tag in idx1 --- lib/avilib-0.6.10/avilib.c | 8 ++++---- tests/results.txt | 1 + tests/test-470avi_idx1_video_not_00db.rb | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tests/test-470avi_idx1_video_not_00db.rb diff --git a/lib/avilib-0.6.10/avilib.c b/lib/avilib-0.6.10/avilib.c index 0e12b8d2d..b8e2fb9e2 100644 --- a/lib/avilib-0.6.10/avilib.c +++ b/lib/avilib-0.6.10/avilib.c @@ -2718,7 +2718,7 @@ int avi_parse_input_file(avi_t *AVI, int getIndex) it is in the file */ for(i=0;in_idx;i++) - if( strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,3)==0 ) break; + if( strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,2)==0 ) break; if(i>=AVI->n_idx) ERR_EXIT(AVI_ERR_NO_VIDS) pos = str2ulong(AVI->idx[i]+ 8); @@ -3130,7 +3130,7 @@ multiple_riff: for(i=0;in_idx;i++) { - if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) nvi++; + if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,2) == 0) nvi++; for(j=0; janum; ++j) if(strncasecmp((char *)AVI->idx[i], AVI->track[j].audio_tag,4) == 0) nai[j]++; } @@ -3159,7 +3159,7 @@ multiple_riff: for(i=0;in_idx;i++) { //video - if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,3) == 0) { + if(strncasecmp((char *)AVI->idx[i],AVI->video_tag,2) == 0) { AVI->video_index[nvi].key = str2ulong(AVI->idx[i]+ 4) & 0x10; AVI->video_index[nvi].pos = str2ulong(AVI->idx[i]+ 8)+ioff; AVI->video_index[nvi].len = str2ulong(AVI->idx[i]+12); @@ -3595,7 +3595,7 @@ int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf, n = PAD_EVEN(str2ulong((unsigned char *)data+4)); - if(strncasecmp(data,AVI->video_tag,3) == 0) + if(strncasecmp(data,AVI->video_tag,2) == 0) { *len = n; AVI->video_pos++; diff --git a/tests/results.txt b/tests/results.txt index cfa61e84b..657ce0023 100644 --- a/tests/results.txt +++ b/tests/results.txt @@ -315,3 +315,4 @@ T_466mkvextract_avi_8bpp:9d8a3a19c80c395ae3efe0ba8c66c2f2:passed:20150223-213412 T_467mpeg_ts_eac3_type_0xa1:6c97721782afd53bc41776abf2d7f445:passed:20150223-221854:0.595330952 T_468extract_cues:337fe77a5fb2f3d30deea092820c7ae8-f58aa81140411b045ce403f4d07de361+b71e065b26dd67f03fff849f1cbb929a:passed:20150225-202605:0.373426759 T_469avi_keyframes:cabe8cc129d7e1f72476c606e7e0f0d2:passed:20150225-223922:0.055489645 +T_470avi_idx1_video_not_00db:12e8b014a66eaefcce54fb128d9a0d52-7f247aaf4412b0b9fb181d22fd96a1db-bff4ad0da7ec16a0cec0ff41733a7539-bb304b822980242f8bc240e58d3dd1af-298d112e745133b54362b61a3edf2238-6fe2d394bf9d3814795860745c19865b:passed:20150227-215810:0.225420656 diff --git a/tests/test-470avi_idx1_video_not_00db.rb b/tests/test-470avi_idx1_video_not_00db.rb new file mode 100644 index 000000000..d71a0422f --- /dev/null +++ b/tests/test-470avi_idx1_video_not_00db.rb @@ -0,0 +1,6 @@ +#!/usr/bin/ruby -w + +# T_470avi_idx1_video_not_00db +describe "mkvmerge / video tracks which use tags in idx1 other than 00db" + +(1..6).each { |idx| test_merge "data/avi/idx1-video-not-00db-#{idx}.avi" }