mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add CodeQL for GitHub code scanning (#1548)
* Create codeql.yml * Addressing codeql findings
This commit is contained in:
@@ -223,13 +223,11 @@ void EncoderThread::processImageMjpeg()
|
||||
{
|
||||
_xform->options = TJXOPT_CROP;
|
||||
_xform->r = tjregion {_cropLeft,_cropTop,transformedWidth,transformedHeight};
|
||||
//qDebug() << "processImageMjpeg() | _doTransform - Image cropped: transformedWidth: " << transformedWidth << " transformedHeight: " << transformedHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
_xform->options = 0;
|
||||
_xform->r = tjregion {0,0,_width,_height};
|
||||
//qDebug() << "processImageMjpeg() | _doTransform - Image not cropped: _width: " << _width << " _height: " << _height;
|
||||
}
|
||||
_xform->options |= TJXOPT_TRIM;
|
||||
|
||||
@@ -344,11 +342,9 @@ bool EncoderThread::onError(const QString context) const
|
||||
#if LIBJPEG_TURBO_VERSION_NUMBER > 2000000
|
||||
if (tjGetErrorCode(_tjInstance) == TJERR_FATAL)
|
||||
{
|
||||
//qDebug() << context << "Error: " << QString(tjGetErrorStr2(_tjInstance));
|
||||
treatAsError = true;
|
||||
}
|
||||
#else
|
||||
//qDebug() << context << "Error: " << QString(tjGetErrorStr());
|
||||
treatAsError = true;
|
||||
#endif
|
||||
|
||||
|
@@ -1209,7 +1209,7 @@ void V4L2Grabber::setCecDetectionEnable(bool enable)
|
||||
{
|
||||
_cecDetectionEnabled = enable;
|
||||
if(_initialized)
|
||||
Info(_log, QString("CEC detection is now %1").arg(enable ? "enabled" : "disabled").toLocal8Bit());
|
||||
Info(_log, "%s", QSTRING_CSTR(QString("CEC detection is now %1").arg(enable ? "enabled" : "disabled")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1501,19 +1501,19 @@ void V4L2Grabber::enumVideoCaptureDevices()
|
||||
|
||||
// Enumerate video control IDs
|
||||
QList<DeviceControls> deviceControlList;
|
||||
for (auto it = _controlIDPropertyMap->constBegin(); it != _controlIDPropertyMap->constEnd(); it++)
|
||||
for (auto itDeviceControls = _controlIDPropertyMap->constBegin(); itDeviceControls != _controlIDPropertyMap->constEnd(); itDeviceControls++)
|
||||
{
|
||||
struct v4l2_queryctrl queryctrl;
|
||||
CLEAR(queryctrl);
|
||||
|
||||
queryctrl.id = it.key();
|
||||
queryctrl.id = itDeviceControls.key();
|
||||
if (xioctl(fd, VIDIOC_QUERYCTRL, &queryctrl) < 0)
|
||||
break;
|
||||
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
|
||||
break;
|
||||
|
||||
DeviceControls control;
|
||||
control.property = it.value();
|
||||
control.property = itDeviceControls.value();
|
||||
control.minValue = queryctrl.minimum;
|
||||
control.maxValue = queryctrl.maximum;
|
||||
control.step = queryctrl.step;
|
||||
@@ -1524,13 +1524,13 @@ void V4L2Grabber::enumVideoCaptureDevices()
|
||||
CLEAR(ctrl);
|
||||
CLEAR(ctrls);
|
||||
|
||||
ctrl.id = it.key();
|
||||
ctrl.id = itDeviceControls.key();
|
||||
ctrls.count = 1;
|
||||
ctrls.controls = &ctrl;
|
||||
if (xioctl(fd, VIDIOC_G_EXT_CTRLS, &ctrls) == 0)
|
||||
{
|
||||
control.currentValue = ctrl.value;
|
||||
DebugIf(verbose, _log, "%s: min=%i, max=%i, step=%i, default=%i, current=%i", QSTRING_CSTR(it.value()), control.minValue, control.maxValue, control.step, control.defaultValue, control.currentValue);
|
||||
DebugIf(verbose, _log, "%s: min=%i, max=%i, step=%i, default=%i, current=%i", QSTRING_CSTR(itDeviceControls.value()), control.minValue, control.maxValue, control.step, control.defaultValue, control.currentValue);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
@@ -170,12 +170,12 @@ bool X11Grabber::setupDisplay()
|
||||
XShmQueryVersion(_x11Display, &dummy, &dummy, &pixmaps_supported);
|
||||
_XShmPixmapAvailable = pixmaps_supported && XShmPixmapFormat(_x11Display) == ZPixmap;
|
||||
|
||||
Info(_log, QString("XRandR=[%1] XRender=[%2] XShm=[%3] XPixmap=[%4]")
|
||||
.arg(_XRandRAvailable ? "available" : "unavailable")
|
||||
.arg(_XRenderAvailable ? "available" : "unavailable")
|
||||
.arg(_XShmAvailable ? "available" : "unavailable")
|
||||
.arg(_XShmPixmapAvailable ? "available" : "unavailable")
|
||||
.toStdString().c_str());
|
||||
Info(_log, "%s", QSTRING_CSTR(QString("XRandR=[%1] XRender=[%2] XShm=[%3] XPixmap=[%4]")
|
||||
.arg(_XRandRAvailable ? "available" : "unavailable",
|
||||
_XRenderAvailable ? "available" : "unavailable",
|
||||
_XShmAvailable ? "available" : "unavailable",
|
||||
_XShmPixmapAvailable ? "available" : "unavailable"))
|
||||
);
|
||||
|
||||
result = (updateScreenDimensions(true) >=0);
|
||||
ErrorIf(!result, _log, "X11 Grabber start failed");
|
||||
|
@@ -242,12 +242,12 @@ bool XcbGrabber::setupDisplay()
|
||||
setupRender();
|
||||
setupShm();
|
||||
|
||||
Info(_log, QString("XcbRandR=[%1] XcbRender=[%2] XcbShm=[%3] XcbPixmap=[%4]")
|
||||
.arg(_XcbRandRAvailable ? "available" : "unavailable")
|
||||
.arg(_XcbRenderAvailable ? "available" : "unavailable")
|
||||
.arg(_XcbShmAvailable ? "available" : "unavailable")
|
||||
.arg(_XcbShmPixmapAvailable ? "available" : "unavailable")
|
||||
.toStdString().c_str());
|
||||
Info(_log, "%s", QSTRING_CSTR(QString("XcbRandR=[%1] XcbRender=[%2] XcbShm=[%3] XcbPixmap=[%4]")
|
||||
.arg(_XcbRandRAvailable ? "available" : "unavailable",
|
||||
_XcbRenderAvailable ? "available" : "unavailable",
|
||||
_XcbShmAvailable ? "available" : "unavailable",
|
||||
_XcbShmPixmapAvailable ? "available" : "unavailable"))
|
||||
);
|
||||
|
||||
result = (updateScreenDimensions(true) >= 0);
|
||||
ErrorIf(!result, _log, "XCB Grabber start failed");
|
||||
|
Reference in New Issue
Block a user