Skip to content

Commit

Permalink
Coverity - Explicit null dereferenced
Browse files Browse the repository at this point in the history
3413259
3413306
  • Loading branch information
Tamir91 committed Dec 20, 2023
1 parent ac06f21 commit 6fe430e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libusb/device-libusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace librealsense
{
if(inf.altsetting->bInterfaceSubClass == RS2_USB_SUBCLASS_VIDEO_CONTROL)
curr_ctrl_intf = curr_inf;
if(inf.altsetting->bInterfaceSubClass == RS2_USB_SUBCLASS_VIDEO_STREAMING)
if(inf.altsetting->bInterfaceSubClass == RS2_USB_SUBCLASS_VIDEO_STREAMING && curr_ctrl_intf)
curr_ctrl_intf->add_associated_interface(curr_inf);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/proc/synthetic-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,12 @@ namespace librealsense
auto bpp = new_bpp * 8;
auto stride = new_stride;

if (bpp == 0)
if( bpp == 0 && vf )
{
bpp = vf->get_bpp();
}

if (width == 0 && stride == 0)
if( width == 0 && stride == 0 && vf )
{
width = vf->get_width();
stride = width * bpp / 8;
Expand All @@ -409,7 +409,7 @@ namespace librealsense
stride = width * bpp / 8;
}

if (height == 0)
if( height == 0 && vf )
{
height = vf->get_height();
}
Expand Down

0 comments on commit 6fe430e

Please sign in to comment.