summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-11-03 01:10:39 +0100
committerCarl Hetherington <cth@carlh.net>2025-11-03 01:50:10 +0100
commitb3056163b9da4425aab25e3c9630a805a48d30ff (patch)
tree12c13dd6f21588e28d8e2d98bd60299456e6337a
parentfaf18d32cd69a293a918c33504f9ad90b906d8a1 (diff)
Missing check for duplicate IDs.
Without this call we don't spot duplicates that are found in the initial scan.
-rwxr-xr-xrun/tests2
-rw-r--r--src/lib/ffmpeg_examiner.cc2
-rw-r--r--test/ffmpeg_examiner_test.cc8
3 files changed, 11 insertions, 1 deletions
diff --git a/run/tests b/run/tests
index c17330dca..b5f45d5e7 100755
--- a/run/tests
+++ b/run/tests
@@ -3,7 +3,7 @@
# e.g. --run_tests=foo
set -e
-PRIVATE_GIT="9c6e881036e5ce29d0e64d8c3159714706ce49f9"
+PRIVATE_GIT="81e32cb5962320333839b7020d14d9f291b8ff2d"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $DIR/environment
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index c50f13ba5..d2e1c9d40 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -99,6 +99,8 @@ FFmpegExaminer::FFmpegExaminer(shared_ptr<const FFmpegContent> c, shared_ptr<Job
job->sub(_("Finding length"));
}
+ check_for_duplicate_ids();
+
/* Run through until we find:
* - the first video.
* - the first audio for each stream.
diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc
index c07900db8..8758c3b78 100644
--- a/test/ffmpeg_examiner_test.cc
+++ b/test/ffmpeg_examiner_test.cc
@@ -93,3 +93,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_examiner_video_stream_selection_test)
BOOST_REQUIRE (examiner->video_frame_rate());
BOOST_CHECK_EQUAL (examiner->video_frame_rate().get(), 25);
}
+
+
+BOOST_AUTO_TEST_CASE(test_crash_during_examination_with_duplicate_ids)
+{
+ auto content = make_shared<FFmpegContent>(TestPaths::private_data() / "hunter.mkv");
+ auto examiner = make_shared<FFmpegExaminer>(content);
+}
+