Skip to content

Commit ce379cc

Browse files
committed
FIX: CCameraSensor would crash at the end of a video file
1 parent 4290b6e commit ce379cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libs/hwdrivers/src/CCameraSensor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,13 @@ CCameraSensor::~CCameraSensor()
630630
----------------------------------------------------- */
631631
CObservation::Ptr CCameraSensor::getNextFrame()
632632
{
633-
vector<CSerializable::Ptr> out_obs;
633+
std::vector<CSerializable::Ptr> out_obs;
634634
getNextFrame(out_obs);
635+
if (out_obs.empty())
636+
{
637+
return {};
638+
}
639+
635640
return std::dynamic_pointer_cast<CObservation>(out_obs[0]);
636641
}
637642

0 commit comments

Comments
 (0)