From 1db23e0f12e8f066fb423f185dfcc69fab09892b Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 30 Nov 2023 15:16:27 +0300 Subject: [PATCH] Report correct open status from Bitstream. --- modules/videoio/src/container_avi.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/videoio/src/container_avi.cpp b/modules/videoio/src/container_avi.cpp index 3223e77090..4aed7c888c 100644 --- a/modules/videoio/src/container_avi.cpp +++ b/modules/videoio/src/container_avi.cpp @@ -3,6 +3,7 @@ // of this distribution and at http://opencv.org/license.html. #include "opencv2/videoio/container_avi.private.hpp" +#include #include #include #include @@ -645,6 +646,11 @@ bool BitStream::open(const String& filename) { close(); output.open(filename.c_str(), std::ios_base::binary); + if (!output.is_open()) + { + CV_LOG_DEBUG(NULL, cv::format("Failed to open stream for writing to \"%s\"", filename.c_str())); + return false; + } m_current = m_start; m_pos = 0; return true;