Skip to content
Snippets Groups Projects
Commit e3a8bba3 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

video: fix nullptr deferencing in video::noise()

Refs #67228

Change-Id: Idb39d86404cf9c420d6971005332d745e64b6114
parent 41b827b1
No related branches found
No related tags found
No related merge requests found
...@@ -132,9 +132,9 @@ void ...@@ -132,9 +132,9 @@ void
VideoFrame::noise() VideoFrame::noise()
{ {
auto f = frame_.get(); auto f = frame_.get();
auto tot = size(); if (f->data[0] == nullptr)
for (int i=0 ; i<tot ; ++i) return;
{ for (std::size_t i=0 ; i < size(); ++i) {
f->data[0][i] = std::rand() & 255; f->data[0][i] = std::rand() & 255;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment