New Defects reported by Coverity Scan for digiKam

scan-admin at coverity.com scan-admin at coverity.com
Sun Jul 17 12:50:41 BST 2022


Hi,

Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.

39 new defect(s) introduced to digiKam found with Coverity Scan.
12 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 39 defect(s)


** CID 1507347:  Uninitialized members  (UNINIT_CTOR)
/mnt/data/Devel/8.x/core/avplayer/main/MainWindow_p.cpp: 30 in AVPlayer::MainWindow::Private::Private()()


________________________________________________________________________________________________________
*** CID 1507347:  Uninitialized members  (UNINIT_CTOR)
/mnt/data/Devel/8.x/core/avplayer/main/MainWindow_p.cpp: 30 in AVPlayer::MainWindow::Private::Private()()
24     
25     namespace AVPlayer
26     {
27     
28     MainWindow::Private::Private()
29     {
>>>     CID 1507347:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "CursorTimer" is not initialized in this constructor nor in any functions that it calls.
30     }
31     
32     MainWindow::Private::~Private()
33     {
34     }
35     

** CID 1507346:  Control flow issues  (MISSING_BREAK)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/mediumformat.cpp: 148 in LibRaw::parse_phase_one(int)()


________________________________________________________________________________________________________
*** CID 1507346:  Control flow issues  (MISSING_BREAK)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/mediumformat.cpp: 148 in LibRaw::parse_phase_one(int)()
142           ph1.black_row = data + base;
143           break;
144         case 0x0226:
145           for (i = 0; i < 9; i++)
146             imgdata.color.P1_color[1].romm_cam[i] = (float)getreal(LIBRAW_EXIFTAG_TYPE_FLOAT);
147           break;
>>>     CID 1507346:  Control flow issues  (MISSING_BREAK)
>>>     The case for value "769U" is not terminated by a "break" statement.
148         case 0x0301:
149           model[63] = 0;
150           fread(imPhaseOne.FirmwareString, 1, 255, ifp);
151           imPhaseOne.FirmwareString[255] = 0;
152           memcpy(model, imPhaseOne.FirmwareString, 63);
153     	  model[63] = 0;

** CID 1507345:  Control flow issues  (NO_EFFECT)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/identify_tools.cpp: 97 in LibRaw::remove_trailing_spaces(char *, unsigned long)()


________________________________________________________________________________________________________
*** CID 1507345:  Control flow issues  (NO_EFFECT)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/identify_tools.cpp: 97 in LibRaw::remove_trailing_spaces(char *, unsigned long)()
91       if (len < 1)
92         return; // not needed, b/c sizeof of make/model is 64
93       string[len - 1] = 0;
94       if (len < 3)
95         return; // also not needed
96       len = strnlen(string, len - 1);
>>>     CID 1507345:  Control flow issues  (NO_EFFECT)
>>>     This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "i >= 0UL".
97       for (size_t i = len - 1; i >= 0; i--)
98       {
99         if (isspace((unsigned char)string[i]))
100           string[i] = 0;
101         else
102           break;

** CID 1507344:  Error handling issues  (CHECKED_RETURN)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxThread.cpp: 154 in QtAV::stepBackwardTask::run()()


________________________________________________________________________________________________________
*** CID 1507344:  Error handling issues  (CHECKED_RETURN)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxThread.cpp: 154 in QtAV::stepBackwardTask::run()()
148                 demux_thread->demuxer->seek(qint64(-pts * 1000.0) - 500LL);
149                 QVector<qreal> ts;
150                 qreal t = -1.0;
151     
152                 while (t < -pts)
153                 {
>>>     CID 1507344:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "readFrame" without checking return value (as is done elsewhere 12 out of 13 times).
154                     demux_thread->demuxer->readFrame();
155     
156                     if (demux_thread->demuxer->stream() != demux_thread->demuxer->videoStream())
157                         continue;
158     
159                     t = demux_thread->demuxer->packet().pts;

** CID 1507343:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/mnt/data/Devel/8.x/core/libs/video/qtav/utils/QtAV_Statistics.h: 118 in ()


________________________________________________________________________________________________________
*** CID 1507343:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/mnt/data/Devel/8.x/core/libs/video/qtav/utils/QtAV_Statistics.h: 118 in ()
112              */
113             int     block_align;
114         } audio_only;
115     
116         // from AVCodecContext
117     
>>>     CID 1507343:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "QtAV::Statistics::VideoOnly" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
118         class DIGIKAM_EXPORT VideoOnly
119         {
120         public:
121     
122             // union member with ctor, dtor, copy ctor only works in c++11
123     

** CID 1507342:  Security best practices violations  (DC.WEAK_CRYPTO)
/mnt/data/Devel/8.x/core/tests/video/qtav/examples/filters/SimpleFilter.cpp: 42 in SimpleFilter::SimpleFilter(QObject *)()


________________________________________________________________________________________________________
*** CID 1507342:  Security best practices violations  (DC.WEAK_CRYPTO)
/mnt/data/Devel/8.x/core/tests/video/qtav/examples/filters/SimpleFilter.cpp: 42 in SimpleFilter::SimpleFilter(QObject *)()
36     SimpleFilter::SimpleFilter(QObject* const parent)
37         : VideoFilter(parent),
38           mCanRot    (true),
39           mWave      (true)
40     {
41         srand(QTime::currentTime().msec());                      // krazy:exclude=syscalls
>>>     CID 1507342:  Security best practices violations  (DC.WEAK_CRYPTO)
>>>     "rand" should not be used for security-related applications, because linear congruential algorithms are too easy to break.
42         mStartValue = (qreal)(rand() % 1000) / qreal(1000.0);    // krazy:exclude=syscalls
43         mTime.start();
44         startTimer(100);
45     }
46     
47     SimpleFilter::~SimpleFilter()

** CID 1507341:  Control flow issues  (NESTING_INDENT_MISMATCH)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/decoders/crx.cpp: 2006 in crxMakeQStep(CrxImage *, CrxTile *, int *, unsigned int)()


________________________________________________________________________________________________________
*** CID 1507341:  Control flow issues  (NESTING_INDENT_MISMATCH)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/decoders/crx.cpp: 2006 in crxMakeQStep(CrxImage *, CrxTile *, int *, unsigned int)()
2000       int qpHeight8 = (tile->height >> 3) + ((tile->height & 7) != 0);
2001       uint32_t totalHeight = qpHeight;
2002       if (img->levels > 1)
2003         totalHeight += qpHeight4;
2004       if (img->levels > 2)
2005         totalHeight += qpHeight8;
>>>     CID 1507341:  Control flow issues  (NESTING_INDENT_MISMATCH)
>>>     This  statement is indented to column 5, as if it were nested within the preceding parent statement, but it is not.
2006         tile->qStep = (CrxQStep *)
2007     #ifdef LIBRAW_CR3_MEMPOOL
2008                           img->memmgr.
2009     #endif
2010                       malloc(totalHeight * qpWidth * sizeof(uint32_t) + img->levels * sizeof(CrxQStep));
2011     

** CID 1507340:  Uninitialized members  (UNINIT_CTOR)
/mnt/data/Devel/8.x/core/avplayer/utils/qoptions.cpp: 39 in AVPlayer::QOption::QOption()()


________________________________________________________________________________________________________
*** CID 1507340:  Uninitialized members  (UNINIT_CTOR)
/mnt/data/Devel/8.x/core/avplayer/utils/qoptions.cpp: 39 in AVPlayer::QOption::QOption()()
33     
34     namespace AVPlayer
35     {
36     
37     QOption::QOption()
38     {
>>>     CID 1507340:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "mType" is not initialized in this constructor nor in any functions that it calls.
39     }
40     
41     QOption::QOption(const char* name, const QVariant& defaultValue,
42                      Type type, const QString& description)
43         : mType        (type),
44           mDescription (description),

** CID 1507339:  Null pointer dereferences  (REVERSE_INULL)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVPlayerCore_p.cpp: 956 in QtAV::AVPlayerCore::Private::tryApplyDecoderPriority(QtAV::AVPlayerCore*)()


________________________________________________________________________________________________________
*** CID 1507339:  Null pointer dereferences  (REVERSE_INULL)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVPlayerCore_p.cpp: 956 in QtAV::AVPlayerCore::Private::tryApplyDecoderPriority(QtAV::AVPlayerCore*)()
950     
951         vthread->packetQueue()->clear();
952         vthread->setDecoder(vd);
953     
954         // MUST delete decoder after video thread set the decoder to ensure the deleted vdec will not be used in vthread!
955     
>>>     CID 1507339:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "this->vdec" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
956         if (vdec)
957             delete vdec;
958     
959         vdec = vd;
960     
961         QObject::connect(vdec, SIGNAL(error(QtAV::AVError)),

** CID 1507338:    (TAINTED_SCALAR)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/misc_parsers.cpp: 264 in LibRaw::parse_riff(int)()
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/misc_parsers.cpp: 269 in LibRaw::parse_riff(int)()


________________________________________________________________________________________________________
*** CID 1507338:    (TAINTED_SCALAR)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/misc_parsers.cpp: 264 in LibRaw::parse_riff(int)()
258       size = get4();
259       end = ftell(ifp) + size;
260       if (!memcmp(tag, "RIFF", 4) || !memcmp(tag, "LIST", 4))
261       {
262         int maxloop = 1000;
263         get4();
>>>     CID 1507338:    (TAINTED_SCALAR)
>>>     Using tainted variable "end" as a loop boundary.
264         while (ftell(ifp) + 7 < end && !feof(ifp) && maxloop--)
265           parse_riff(maxdepth-1);
266       }
267       else if (!memcmp(tag, "nctg", 4))
268       {
269         while (ftell(ifp) + 7 < end)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/src/metadata/misc_parsers.cpp: 269 in LibRaw::parse_riff(int)()
263         get4();
264         while (ftell(ifp) + 7 < end && !feof(ifp) && maxloop--)
265           parse_riff(maxdepth-1);
266       }
267       else if (!memcmp(tag, "nctg", 4))
268       {
>>>     CID 1507338:    (TAINTED_SCALAR)
>>>     Using tainted variable "end" as a loop boundary.
269         while (ftell(ifp) + 7 < end)
270         {
271           i = get2();
272           size = get2();
273           if ((i + 1) >> 1 == 10 && size == 20)
274             get_timestamp(0);

** CID 1504151:    (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxer.cpp: 889 in QtAV::AVDemuxer::seek(long long)()
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxer.cpp: 867 in QtAV::AVDemuxer::seek(long long)()


________________________________________________________________________________________________________
*** CID 1504151:    (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxer.cpp: 889 in QtAV::AVDemuxer::seek(long long)()
883                     << duration()
884                     << "=>"
885                     << qint64(d->max_pts*1000.0);
886             }
887             else
888             {
>>>     CID 1504151:    (DIVIDE_BY_ZERO)
>>>     In expression "(double)upos / (double)this->durationUs()", division by expression "this->durationUs()" which may be zero has undefined behavior.
889                 qCWarning(DIGIKAM_QTAV_LOG_WARN)
890                     << "Invalid seek position"
891                     << upos
892                     << double(upos) / double(durationUs())
893                     << "valid range ["
894                     << startTimeUs()
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxer.cpp: 867 in QtAV::AVDemuxer::seek(long long)()
861         qint64 upos = pos * 1000LL; // TODO: av_rescale
862     
863         if ((upos > (startTimeUs() + durationUs())) || (pos < 0LL))
864         {
865             if      ((pos >= 0LL) && d->input && d->input->isSeekable() && d->input->isVariableSize())
866             {
>>>     CID 1504151:    (DIVIDE_BY_ZERO)
>>>     In expression "(double)upos / (double)this->durationUs()", division by expression "this->durationUs()" which may be zero has undefined behavior.
867                 qCDebug(DIGIKAM_QTAV_LOG)
868                     << "Seek for variable size hack."
869                     << upos << double(upos) / double(durationUs())
870                     << "valid range ["
871                     << startTimeUs()
872                     << startTimeUs() + durationUs()

** CID 1504149:  Incorrect expression  (PRECEDENCE_ERROR)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/samples/dcraw_emu.cpp: 521 in main()


________________________________________________________________________________________________________
*** CID 1504149:  Incorrect expression  (PRECEDENCE_ERROR)
/mnt/data/Devel/8.x/core/libs/rawengine/libraw/samples/dcraw_emu.cpp: 521 in main()
515     		if (!mapping.map)
516     		{
517     			fprintf(stderr, "Cannot map %s\n", argv[arg]);
518     			close_mapping(mapping);
519     			continue;
520     		}
>>>     CID 1504149:  Incorrect expression  (PRECEDENCE_ERROR)
>>>     Evaluates as: "ret = (RawProcessor.open_buffer(mapping.map, mapping.fsize) != LIBRAW_SUCCESS)", because "!=" has higher operator precedence than "=". The context suggests that this might be in error.
521           if ((ret = RawProcessor.open_buffer(mapping.map,mapping.fsize) !=
522                      LIBRAW_SUCCESS))
523           {
524             fprintf(stderr, "Cannot open_buffer %s: %s\n", argv[arg], libraw_strerror(ret));
525     		close_mapping(mapping);
526             continue; // no recycle b/c open file will recycle itself

** CID 1504145:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AudioFormat.h: 43 in ()


________________________________________________________________________________________________________
*** CID 1504145:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AudioFormat.h: 43 in ()
37     
38     namespace QtAV
39     {
40     
41     class AudioFormatPrivate;
42     
>>>     CID 1504145:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "QtAV::AudioFormat" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
43     class DIGIKAM_EXPORT AudioFormat
44     {
45         enum
46         {
47             kSize      = 12,
48             kFloat     = 1 << (kSize + 1),

** CID 1504143:  Incorrect expression  (DIVIDE_BY_ZERO)


________________________________________________________________________________________________________
*** CID 1504143:  Incorrect expression  (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/SubImagesGeometry.cpp: 286 in QtAV::SubImagesGeometry::generateVertexData(const QRect &, bool, int)()
280         {
281     /*
282             qCDebug(DIGIKAM_QTAV_LOG) << rect;
283             qCDebug(DIGIKAM_QTAV_LOG).noquote()
284                 << QString::asprintf("i: %d,%d", i.x, i.y);
285     */
>>>     CID 1504143:  Incorrect expression  (DIVIDE_BY_ZERO)
>>>     In function call "SetVertexPositionAndNormalize", division by expression "this->m_h" which may be zero has undefined behavior.
286             vd           = SetVertexPositionAndNormalize(vd,
287                                                          dx0 + float(i.x) * sx,
288                                                          dy0 + float(i.y) * sy,
289                                                          i.w * sx,
290                                                          i.h * sy,
291                                                          m_w,

** CID 1504140:  Security best practices violations  (STRING_OVERFLOW)
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/gl_api.cpp: 89 in QtAV::GetProcAddressWithExt(void *(*)(const char *), const char *)()


________________________________________________________________________________________________________
*** CID 1504140:  Security best practices violations  (STRING_OVERFLOW)
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/gl_api.cpp: 89 in QtAV::GetProcAddressWithExt(void *(*)(const char *), const char *)()
83     #endif
84     
85           , nullptr
86         };
87     
88         char f[512]   = { 0 };
>>>     CID 1504140:  Security best practices violations  (STRING_OVERFLOW)
>>>     You might overrun the 512-character fixed-size string "f" by copying "name" without checking the length.
89         memcpy(f, name, strlen(name));
90         char* const p = f + strlen(name);
91     
92         for (int i = 0 ; ext[i] ; ++i)
93         {
94             memcpy(p, ext[i], sizeof(ext[i]) + 1); // copy trail '\0'

** CID 1504138:  Incorrect expression  (USELESS_CALL)


________________________________________________________________________________________________________
*** CID 1504138:  Incorrect expression  (USELESS_CALL)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AVDemuxThread.cpp: 331 in QtAV::AVDemuxThread::stepBackward()()
325         }
326     
327     
328         pause(true);
329     
330         t->packetQueue()->clear();  // will put new packets before task run
>>>     CID 1504138:  Incorrect expression  (USELESS_CALL)
>>>     Calling "t->packetQueue()" is only useful for its return value, which is ignored.
331         t->packetQueue();
332         Packet pkt;
333         pkt.pts = pre_pts;
334         t->packetQueue()->put(pkt); // clear and put a seek packet to ensure not frames other than previous frame will be decoded and rendered
335         video_thread->pause(false);
336         newSeekRequest(new stepBackwardTask(this, pre_pts));

** CID 1504137:  Integer handling issues  (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AudioFormat.cpp: 420 in QtAV::AudioFormat::durationForBytes(int) const()


________________________________________________________________________________________________________
*** CID 1504137:  Integer handling issues  (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/ffmpeg/AudioFormat.cpp: 420 in QtAV::AudioFormat::durationForBytes(int) const()
414     {
415         if (!isValid() || (bytes <= 0))
416             return 0;
417     
418         // We round the byte count to ensure whole frames
419     
>>>     CID 1504137:  Integer handling issues  (DIVIDE_BY_ZERO)
>>>     In expression "bytes / this->bytesPerFrame()", division by expression "this->bytesPerFrame()" which may be zero has undefined behavior.
420         return qint64(kHz * (bytes / bytesPerFrame())) / sampleRate();
421     }
422     
423     /*!
424      * Returns the number of bytes required for \a frameCount frames of this format.
425      *

** CID 1504135:  Control flow issues  (UNREACHABLE)
/mnt/data/Devel/8.x/core/libs/video/qtav/codec/audio/AudioDecoderFFmpeg.cpp: 231 in QtAV::AudioDecoderFFmpeg::decode(const QtAV::Packet &)()


________________________________________________________________________________________________________
*** CID 1504135:  Control flow issues  (UNREACHABLE)
/mnt/data/Devel/8.x/core/libs/video/qtav/codec/audio/AudioDecoderFFmpeg.cpp: 231 in QtAV::AudioDecoderFFmpeg::decode(const QtAV::Packet &)()
225     #if USE_AUDIO_FRAME
226     
227         return true;
228     
229     #endif
230     
>>>     CID 1504135:  Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "d.resampler->setInSampesPer...".
231         d.resampler->setInSampesPerChannel(d.frame->nb_samples);
232     
233         if (!d.resampler->convert((const quint8**)d.frame->extended_data))
234         {
235             return false;
236         }

** CID 1504133:  Control flow issues  (UNREACHABLE)
/mnt/data/Devel/8.x/core/libs/video/qtav/cuda/helper_cuda.h: 96 in _cudaGetErrorEnum(cudaError_enum)()


________________________________________________________________________________________________________
*** CID 1504133:  Control flow issues  (UNREACHABLE)
/mnt/data/Devel/8.x/core/libs/video/qtav/cuda/helper_cuda.h: 96 in _cudaGetErrorEnum(cudaError_enum)()
90             case CUDA_ERROR_CONTEXT_IS_DESTROYED:           return "CUDA_ERROR_CONTEXT_IS_DESTROYED";
91             case CUDA_ERROR_LAUNCH_FAILED:                  return "CUDA_ERROR_LAUNCH_FAILED";
92             case CUDA_ERROR_UNKNOWN:                        return "CUDA_ERROR_UNKNOWN";
93             default:                                        return "CUDA_ERROR_UNKNOWN";
94         }
95     
>>>     CID 1504133:  Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "return "<unknown>";".
96         return "<unknown>";
97     }
98     
99     #endif // QTAV_DYNLINK_CUDA_H
100     
101     // from helper_cuda

** CID 1504130:    (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1464 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1464 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1465 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1465 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()


________________________________________________________________________________________________________
*** CID 1504130:    (DIVIDE_BY_ZERO)
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1464 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
1458             << QString::asprintf("bpp %d, bpc: %d",
1459                 fmt.bytesPerPixel(), fmt.bitsPerComponent());
1460     
1461         for (int i = 0 ; i < nb_planes ; ++i)
1462         {
1463             const int bpp_gl        = OpenGLHelper::bytesOfGLFormat(data_format[i], data_type[i]);
>>>     CID 1504130:    (DIVIDE_BY_ZERO)
>>>     In expression "(qreal)(this->texture_size[i]->width() - this->effective_tex_width[i]) / (qreal)bpp_gl", division by expression "bpp_gl" which may be zero has undefined behavior.
1464             const int pad           = std::ceil((qreal)(texture_size[i].width() - effective_tex_width[i]) / (qreal)bpp_gl);
1465             texture_size[i].setWidth(std::ceil((qreal)texture_size[i].width() / (qreal)bpp_gl));
1466             effective_tex_width[i] /= bpp_gl; // fmt.bytesPerPixel(i);
1467             v_texture_size[i]       = QVector2D(texture_size[i].width(), texture_size[i].height());
1468     
1469             // effective_tex_width_ratio =
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1464 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
1458             << QString::asprintf("bpp %d, bpc: %d",
1459                 fmt.bytesPerPixel(), fmt.bitsPerComponent());
1460     
1461         for (int i = 0 ; i < nb_planes ; ++i)
1462         {
1463             const int bpp_gl        = OpenGLHelper::bytesOfGLFormat(data_format[i], data_type[i]);
>>>     CID 1504130:    (DIVIDE_BY_ZERO)
>>>     In expression "(qreal)(this->texture_size[i]->width() - this->effective_tex_width[i]) / (qreal)bpp_gl", division by expression "bpp_gl" which may be zero has undefined behavior.
1464             const int pad           = std::ceil((qreal)(texture_size[i].width() - effective_tex_width[i]) / (qreal)bpp_gl);
1465             texture_size[i].setWidth(std::ceil((qreal)texture_size[i].width() / (qreal)bpp_gl));
1466             effective_tex_width[i] /= bpp_gl; // fmt.bytesPerPixel(i);
1467             v_texture_size[i]       = QVector2D(texture_size[i].width(), texture_size[i].height());
1468     
1469             // effective_tex_width_ratio =
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1465 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
1459                 fmt.bytesPerPixel(), fmt.bitsPerComponent());
1460     
1461         for (int i = 0 ; i < nb_planes ; ++i)
1462         {
1463             const int bpp_gl        = OpenGLHelper::bytesOfGLFormat(data_format[i], data_type[i]);
1464             const int pad           = std::ceil((qreal)(texture_size[i].width() - effective_tex_width[i]) / (qreal)bpp_gl);
>>>     CID 1504130:    (DIVIDE_BY_ZERO)
>>>     In expression "(qreal)this->texture_size[i]->width() / (qreal)bpp_gl", division by expression "bpp_gl" which may be zero has undefined behavior.
1465             texture_size[i].setWidth(std::ceil((qreal)texture_size[i].width() / (qreal)bpp_gl));
1466             effective_tex_width[i] /= bpp_gl; // fmt.bytesPerPixel(i);
1467             v_texture_size[i]       = QVector2D(texture_size[i].width(), texture_size[i].height());
1468     
1469             // effective_tex_width_ratio =
1470     
/mnt/data/Devel/8.x/core/libs/video/qtav/opengl/VideoShader.cpp: 1465 in QtAV::VideoMaterialPrivate::updateTextureParameters(const QtAV::VideoFormat &)()
1459                 fmt.bytesPerPixel(), fmt.bitsPerComponent());
1460     
1461         for (int i = 0 ; i < nb_planes ; ++i)
1462         {
1463             const int bpp_gl        = OpenGLHelper::bytesOfGLFormat(data_format[i], data_type[i]);
1464             const int pad           = std::ceil((qreal)(texture_size[i].width() - effective_tex_width[i]) / (qreal)bpp_gl);
>>>     CID 1504130:    (DIVIDE_BY_ZERO)
>>>     In expression "(qreal)this->texture_size[i]->width() / (qreal)bpp_gl", division by expression "bpp_gl" which may be zero has undefined behavior.
1465             texture_size[i].setWidth(std::ceil((qreal)texture_size[i].width() / (qreal)bpp_gl));
1466             effective_tex_width[i] /= bpp_gl; // fmt.bytesPerPixel(i);
1467             v_texture_size[i]       = QVector2D(texture_size[i].width(), texture_size[i].height());
1468     
1469             // effective_tex_width_ratio =
1470     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yp2OAl-2Fauo86CB28HCT0-2BnD-2F6eFMYt863B1-2B0FLvU5y-2FRWSl8rMA4vGwCkGPp0f1hg-3DedGK_IpEMwFcbl-2BY9RHaL2m6a3nuAxB4hfm4MTniX0gHjADVTVyHnpuKpv1XiY4noSNr-2F2h3QmPWODhibybsrjT-2BGvTdhVP0YJqBf0es3J-2F3rnZPUxruIsBFHg6tpdtVniR3cfdZFLoonY8qqxZxDb-2Br9GsIfTFYVhjMmwvk2sHT7jpLPJbqB4sEcGSYMwhSD3IzDs29uynR-2FVFdMB0Es4dkq4A-3D-3D



More information about the Digikam-devel mailing list