{"id":233489,"date":"2014-08-15T16:12:08","date_gmt":"2014-08-15T12:12:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=233489"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=233489","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 GIMP \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/154\/ac2\/0a2\/154ac20a216b5651b77a964d42d24544.png\" alt=\"PVS-Studio and GIMP\" align=\"left\"\/><br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c GIMP, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0430\u0441\u044c. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439, \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u0435\u043d\u044c \u0431\u044b\u043b\u0430 \u043f\u043e\u0431\u0435\u0436\u0434\u0435\u043d\u0430, \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d.<br \/>  <a name=\"habracut\"><\/a>   <\/p>\n<h2>GIMP<\/h2>\n<p>  \u041c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <a href=\"http:\/\/www.gimp.org\/\">GIMP<\/a>, \u0445\u043e\u0442\u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u044d\u0442\u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u041d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c Photoshop \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u0435\u0434\u0438\u043d\u043e\u0440\u043e\u0433\u043e\u043c \u0434\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c Paint \u0438 GIMP \u043c\u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044f \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u0443\u0434\u0438\u0442\u044c \u043e\u0431 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0442\u0443\u043b\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0441\u0438\u0434\u0435\u0442\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0440\u0447\u0430\u0449\u0438\u0445 \u0433\u0432\u043e\u0437\u0434\u0435\u0439, \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043b\u043e\u0442\u043d\u0438\u043a\u043e\u043c \u0438\u043b\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u043f\u043e \u043c\u0435\u0431\u0435\u043b\u0438. \u042f \u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0434\u0435\u043b\u043e\u043a \u0432 GIMP, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043c\u0435\u0448\u0430\u044e\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043f\u043e\u043b\u0435 Location, \u0435\u0441\u043b\u0438 \u043f\u0443\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u0443\u043a\u0432\u044b \u043d\u0430 \u0440\u0443\u0441\u0441\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0422\u0430\u043a\u0438\u0445 \u043d\u0435\u0434\u043e\u0447\u0451\u0442\u043e\u0432 \u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>  \u0411\u0443\u0434\u0443\u0447\u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c \u0441 \u043a\u043e\u0440\u044f\u0432\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c GIMP, \u044f \u043e\u0436\u0438\u0434\u0430\u043b, \u0447\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u044f \u043d\u0430\u0439\u0434\u0443 \u043c\u043d\u043e\u0433\u043e \u043b\u044f\u043f\u043e\u0432. \u042f \u043e\u0448\u0438\u0431\u0430\u043b\u0441\u044f. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435. \u041f\u0440\u0438\u0447\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u044f\u0436\u0451\u043b\u0443\u044e \u0430\u0440\u0442\u0438\u043b\u043b\u0435\u0440\u0438\u044e. \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043c\u043e\u0449\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u2014 Coverity.<\/p>\n<p>  \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Coverity, \u044f \u0441\u0443\u0436\u0443 \u043f\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u0430\u043a \u00abcoverity.sh\u00bb. \u041f\u043b\u044e\u0441 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435:<\/p>\n<p>  <i>\u041f\u0440\u043e\u0435\u043a\u0442 Coverity, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0430\u043c\u0435\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432\u043e\u0439\u0434\u0443\u0442 \u043e\u043a\u043e\u043b\u043e 100 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439, \u0432 \u0447\u0438\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 Scribus, GIMP, Inkscape, Krita, Blender \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 (\u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 2007 \u0433\u043e\u0434\u0443).<\/i> <\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u0434\u0435 GIMP \u043f\u043e\u0441\u043b\u0435 Coverity. \u0410\u043d\u0430\u043b\u0438\u0437 \u0431\u044b\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/www.viva64.com\/ru\/pvs-studio\/\">PVS-Studio<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 5.18.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N1-N3<\/b>  <\/p>\n<pre><code class=\"cpp\">typedef double gdouble;  GimpBlob * gimp_blob_square (gdouble xc,                   gdouble yc,                   gdouble xp,                   gdouble yp,                   gdouble xq,                   gdouble yq) {   GimpBlobPoint points[4];    \/* Make sure we order points ccw *\/   if (xp * yq - yq * xp &lt; 0)   {     xq = -xq;     yq = -yq;   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V501 There are identical sub-expressions to the left and to the right of the &#8216;-&#8216; operator: xp * yq \u2014 yq * xp gimpink-blob.c 162<\/p>\n<p>  \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00abxp * yq \u2014 yq * xp\u00bb \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00abxp*yq\u00bb \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e \u0438\u0437 \u0441\u0435\u0431\u044f.<\/p>\n<p>  \u0418\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u0421\u0442\u0440\u043e\u043a\u0438: 195 \u0438 278.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N4<\/b>  <\/p>\n<pre><code class=\"cpp\">gint64 gimp_g_value_get_memsize (GValue *value) {   ....   GimpArray *array = g_value_get_boxed (value);    if (array)     memsize += (sizeof (GimpArray) +                 array-&gt;static_data ? 0 : array-&gt;length);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V502 Perhaps the &#8216;?:&#8217; operator works in a different way than it was expected. The &#8216;?:&#8217; operator has a lower priority than the &#8216;+&#8217; operator. gimp-utils.c 233<\/p>\n<p>  \u041f\u0443\u0442\u0430\u043d\u0438\u0446\u0430 \u0432 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041a \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043d\u0435\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c 0 \u0438\u043b\u0438 \u00abarray-&gt;length\u00bb. \u041d\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;+&#8217; \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?:&#8217;. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"cpp\">memsize += ((sizeof (GimpArray) + array-&gt;static_data) ?             0 : array-&gt;length);<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0437\u043d\u0430\u043b \u043e\u0431 \u044d\u0442\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043a\u043e\u0431\u043a\u0438. \u041d\u043e \u0442\u043e\u0433\u0434\u0430, \u0441\u043a\u043e\u0431\u043a\u0438 \u0441\u0442\u043e\u044f\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043c\u0435\u0441\u0442\u0435. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">memsize += sizeof (GimpArray) +            (array-&gt;static_data ? 0 : array-&gt;length);<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N5, N6<\/b>  <\/p>\n<pre><code class=\"cpp\">#define cmsFLAGS_NOOPTIMIZE 0x0100 #define cmsFLAGS_BLACKPOINTCOMPENSATION 0x2000  static void lcms_layers_transform_rgb (...., gboolean bpc) {   ....   transform = cmsCreateTransform (     src_profile,  lcms_format,     dest_profile, lcms_format,     intent,     cmsFLAGS_NOOPTIMIZE |     bpc ? cmsFLAGS_BLACKPOINTCOMPENSATION : 0);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V502 Perhaps the &#8216;?:&#8217; operator works in a different way than it was expected. The &#8216;?:&#8217; operator has a lower priority than the &#8216;|&#8217; operator. lcms.c 1016<\/p>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#8216;bpc&#8217; \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u043b\u0430\u0433 \u00abcmsFLAGS_BLACKPOINTCOMPENSATION\u00bb \u0438\u043b\u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 \u00abcmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_NOOPTIMIZE\u00bb.<\/p>\n<p>  \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;|&#8217; \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?:&#8217;. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?:&#8217; \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00abcmsFLAGS_NOOPTIMIZE | bpc\u00bb. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0444\u043b\u0430\u0433 cmsFLAGS_BLACKPOINTCOMPENSATION.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">transform = cmsCreateTransform (   src_profile,  lcms_format,   dest_profile, lcms_format,   intent,   cmsFLAGS_NOOPTIMIZE |   (bpc ? cmsFLAGS_BLACKPOINTCOMPENSATION : 0));<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c: lcms.c 1016.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N7<\/b>  <\/p>\n<pre><code class=\"cpp\">static gint load_resource_lrfx (....) {   ....   else if (memcmp (effectname, &quot;oglw&quot;, 4) == 0)  &lt;&lt;&lt;===   ....   else if (memcmp (effectname, &quot;iglw&quot;, 4) == 0)   ....   else if (memcmp (effectname, &quot;oglw&quot;, 4) == 0)  &lt;&lt;&lt;===   ....   else if (memcmp (effectname, &quot;bevl&quot;, 4) == 0)   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V517 The use of &#8216;if (A) {&#8230;} else if (A) {&#8230;}&#8217; pattern was detected. There is a probability of logical error presence. Check lines: 602, 688. psd-layer-res-load.c 602<\/p>\n<p>  \u0414\u0432\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 if-elseif-elseif-\u2026<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N8<\/b>  <\/p>\n<pre><code class=\"cpp\">void gimp_text_get_transformation (GimpText    *text,                               GimpMatrix3 *matrix) {   g_return_if_fail (GIMP_IS_TEXT (text));   g_return_if_fail (matrix != NULL);    matrix-&gt;coeff[0][0] = text-&gt;transformation.coeff[0][0];   matrix-&gt;coeff[0][1] = text-&gt;transformation.coeff[0][1];   matrix-&gt;coeff[0][2] = text-&gt;offset_x;    matrix-&gt;coeff[1][0] = text-&gt;transformation.coeff[1][0];   matrix-&gt;coeff[1][1] = text-&gt;transformation.coeff[1][1];   matrix-&gt;coeff[1][2] = text-&gt;offset_y;    matrix-&gt;coeff[2][0] = 0.0;   matrix-&gt;coeff[2][1] = 0.0;   matrix-&gt;coeff[2][1] = 1.0;     &lt;&lt;&lt;=== }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V519 The &#8216;matrix-&gt;coeff[2][1]&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 567, 568. gimptext.c 568<\/p>\n<p>  <a href=\"http:\/\/www.viva64.com\/ru\/b\/0260\/\">\u042d\u0444\u0444\u0435\u043a\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/a>. \u0412 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441. \u0414\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c:  <\/p>\n<pre><code class=\"cpp\">matrix-&gt;coeff[2][0] = 0.0; matrix-&gt;coeff[2][1] = 0.0; matrix-&gt;coeff[2][2] = 1.0;<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N9<\/b>   <\/p>\n<pre><code class=\"cpp\">static void warp_one (....) {   ....   if (first_time)     gimp_pixel_rgn_init (&amp;dest_rgn,                          new, x1, y1, (x2 - x1), (y2 - y1),                          TRUE, TRUE);   else     gimp_pixel_rgn_init (&amp;dest_rgn,                          new, x1, y1, (x2 - x1), (y2 - y1),                          TRUE, TRUE);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V523 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. warp.c 1366<\/p>\n<p>  \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. <\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N10, N11, N12<\/b>  <\/p>\n<pre><code class=\"cpp\">gboolean gimp_wire_read (GIOChannel *channel,   guint8     *buf,   gsize       count,   gpointer    user_data) {   g_return_val_if_fail (count &gt;= 0, FALSE);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;count &gt;= 0&#8217; is always true. Unsigned type value is always &gt;= 0. gimpwire.c 99<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u00abcount &gt;= 0\u00bb \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;count&#8217; \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043e \u043d\u0435\u0439 \u0441\u0442\u043e\u0438\u0442. <\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: gimpwire.c 170; gimpcageconfig.c 428.<\/p>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V547, \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043d\u0438\u0436\u0435.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N13<\/b>  <\/p>\n<pre><code class=\"cpp\">static GimpPlugInImageType image_types_parse (const gchar *name,                    const gchar *image_types) {   ....   while (*image_types &amp;&amp;          ((*image_types != ' ') ||           (*image_types != '\\t') ||           (*image_types != ',')))     {       image_types++;     }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: V547 Expression is always true. Probably the &#8216;&amp;&amp;&#8217; operator should be used here. gimppluginprocedure.c 808<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u044f\u0441\u043d\u044e \u043d\u0430 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:  <\/p>\n<pre><code class=\"cpp\">int A = ...; if ( A != 1  ||  A != 2  ||  A != 3)<\/code><\/pre>\n<p>  \u0427\u0435\u043c\u0443 \u0431\u044b \u043d\u0438 \u0431\u044b\u043b\u0430 \u0440\u0430\u0432\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f A, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N14<\/b>  <\/p>\n<pre><code class=\"cpp\">static gunichar basic_inchar(port *pt) {   ....   gunichar c;   ....   c = g_utf8_get_char_validated(pt-&gt;rep.string.curr, len);    if (c &gt;= 0)   \/* Valid UTF-8 character? *\/   {     len = g_unichar_to_utf8(c, NULL);     pt-&gt;rep.string.curr += len;     return c;   }    \/* Look for next valid UTF-8 character in buffer *\/   pt-&gt;rep.string.curr = g_utf8_find_next_char(                           pt-&gt;rep.string.curr,                           pt-&gt;rep.string.past_the_end);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;c &gt;= 0&#8217; is always true. Unsigned type value is always &gt;= 0. scheme.c 1654<\/p>\n<p>  \u0412\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 UTF-8 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;c&#8217; \u0438\u043c\u0435\u0435\u0442 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 (c &gt;= 0) \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N15<\/b>   <\/p>\n<pre><code class=\"cpp\">#define ABS(a)     (((a) &lt; 0) ? -(a) : (a))  static gint32 load_thumbnail (...., gint32 thumb_size, ....) {   ....   guint32 size;   guint32 diff;   ....   diff = ABS(thumb_size - size);   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V547 Expression &#8216;(thumb_size \u2014 size) &lt; 0&#8217; is always false. Unsigned type value is never &lt; 0. file-xmc.c 874<\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;thumb_size&#8217; \u0440\u0430\u0432\u043d\u0430 10, \u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;size&#8217; \u0440\u0430\u0432\u043d\u0430 25.<\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 15. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d 0xFFFFFFF1 (4294967281).<\/p>\n<p>  \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00abthumb_size \u2014 size\u00bb \u0438\u043c\u0435\u0435\u0442 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0447\u0438\u0441\u043b\u043e 0xFFFFFFF1u. \u041c\u0430\u043a\u0440\u043e\u0441 ABS \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N16<\/b>   <\/p>\n<pre><code class=\"cpp\">static gchar * script_fu_menu_map (const gchar *menu_path) {   ....   const gchar *suffix = menu_path + strlen (mapping[i].old);   if (! *suffix == '\/')     continue;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V562 It&#8217;s odd to compare 0 or 1 with a value of 47: !* suffix == &#8216;\/&#8217;. script-fu-scripts.c 859<\/p>\n<p>  \u0412\u043d\u043e\u0432\u044c \u0431\u0435\u0434\u0430 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 &quot;!*suffix&quot;. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 0 \u0438\u043b\u0438 1. \u042d\u0442\u043e\u0442 \u043d\u043e\u043b\u044c \u0438\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c &#8216;\/&#8217;, \u0447\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">if (*suffix != '\/')<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N17<\/b>   <\/p>\n<pre><code class=\"cpp\">static void save_file_chooser_response (GtkFileChooser *chooser,                             gint            response_id,                             GFigObj        *obj) {   ....   gfig_context-&gt;current_obj = obj;   gfig_save_callbk ();   gfig_context-&gt;current_obj = gfig_context-&gt;current_obj;     .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V570 The &#8216;gfig_context-&gt;current_obj&#8217; variable is assigned to itself. gfig-dialog.c 1623<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u0430 \u0432 \u0441\u0435\u0431\u044f.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N18<\/b>   <\/p>\n<pre><code class=\"cpp\">size g_strlcpy(gchar *dest, const gchar *src, gsize dest_size);  GList * gimp_brush_generated_load (....) {   ....   gchar *string;   ....   \/* the empty string is not an allowed name *\/   if (strlen (string) &lt; 1)     g_strlcpy (string, _(&quot;Untitled&quot;), sizeof (string));   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS_Studio: V579 The g_strlcpy function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. gimpbrushgenerated-load.c 119<\/p>\n<p>  \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u00absizeof(string)\u00bb \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430.<\/p>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N19<\/b>   <\/p>\n<pre><code class=\"cpp\">static gboolean save_image (....) {   ....   gint c;   ....   if (has_alpha &amp;&amp; (data[rowoffset + k + 1] &lt; 128))     c |= 0 &lt;&lt; (thisbit ++);   else   ....    }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V684 A value of the variable &#8216;c&#8217; is not modified. Consider inspecting the expression. It is possible that &#8216;1&#8217; should be present instead of &#8216;0&#8217;. file-xbm.c 1136<\/p>\n<p>  \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00abc |= 0 &lt;&lt; (thisbit ++);\u00bb \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#8216;c&#8217;.<\/p>\n<p>  \u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044e, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0431\u0438\u0442, \u043d\u043e \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">c &amp;= ~(1u &lt;&lt; (thisbit ++));<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N20<\/b>   <\/p>\n<pre><code class=\"cpp\">gboolean gimp_item_get_popup_size (....,     gint *popup_width, gint *popup_height) {   ....   if (scaling_up)   {     *popup_width = gimp_item_get_width  (item);     *popup_width = gimp_item_get_height (item);   }   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V537 Consider reviewing the correctness of &#8216;popup_width&#8217; item&#8217;s usage. gimpitem-preview.c 126<\/p>\n<p>  \u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 Copy-Paste. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">*popup_width = gimp_item_get_width (item); *popup_height = gimp_item_get_height (item);<\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N21<\/b>   <\/p>\n<pre><code class=\"cpp\">gboolean gimp_draw_tool_on_vectors_curve (....,   GimpAnchor       **ret_segment_start,   GimpAnchor       **ret_segment_end,   ....) {   ....   if (ret_segment_start) *ret_segment_start = NULL;   if (ret_segment_start) *ret_segment_end   = NULL;   .... }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V581 The conditional expressions of the &#8216;if&#8217; operators situated alongside each other are identical. Check lines: 1212, 1213. gimpdrawtool.c 1213<\/p>\n<p>  \u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 Copy-Paste. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cpp\">if (ret_segment_start) *ret_segment_start = NULL; if (ret_segment_end) *ret_segment_end = NULL; <\/code><\/pre>\n<p>  <b>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 N22-N40<\/b>   <\/p>\n<pre><code class=\"cpp\">ObjectList_t* object_list_append_list(ObjectList_t *des, ObjectList_t *src) {    GList *p;    for (p = src-&gt;list; p; p = p-&gt;next)       object_list_append(des, object_clone((Object_t*) p-&gt;data));    object_list_set_changed(des, (src) ? TRUE : FALSE);    return des; }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: V595 The &#8216;src&#8217; pointer was utilized before it was verified against nullptr. Check lines: 536, 538. imap_object.c 536<\/p>\n<p>  \u0418\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f &quot;(src)? TRUE: FALSE&quot; \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c &#8216;src&#8217; \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u0435\u043d nullptr.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u044b\u0448\u0435 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u0435\u043b\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u00abp = src-&gt;list\u00bb, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0432\u044b\u0434\u0430\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 V595. \u042d\u0442\u0438 \u043c\u0435\u0441\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c:<\/p>\n<ul>\n<li>The &#8216;l&#8217; pointer. Check lines: 262, 265. gimpimage-item-list.c 262<\/li>\n<li>The &#8216;quantobj&#8217; pointer. Check lines: 965, 971. gimpimage-convert-type.c 965<\/li>\n<li>The &#8216;slist&#8217; pointer. Check lines: 683, 685. gimpfont.c 683<\/li>\n<li>The &#8216;dock_window-&gt;p-&gt;context&#8217; pointer. Check lines: 487, 504. gimpdockwindow.c 487<\/li>\n<li>The &#8216;layer_renderer&#8217; pointer. Check lines: 1245, 1275. gimplayertreeview.c 1245<\/li>\n<li>The &#8216;shell-&gt;display&#8217; pointer. Check lines: 574, 588. gimpdisplayshell-dnd.c 574<\/li>\n<li>The &#8216;ops&#8217; pointer. Check lines: 265, 267. gimpgegltool.c 265<\/li>\n<li>The &#8216;dialog&#8217; pointer. Check lines: 234, 249. file-save-dialog.c 234<\/li>\n<li>The &#8216;shell&#8217; pointer. Check lines: 738, 763. view-actions.c 738<\/li>\n<li>The &#8216;fname&#8217; pointer. Check lines: 1426, 1437. scheme.c 1426<\/li>\n<li>The &#8216;sgip-&gt;table&#8217; pointer. Check lines: 148, 161. sgi-lib.c 148<\/li>\n<li>The &#8216;sgip-&gt;length&#8217; pointer. Check lines: 154, 167. sgi-lib.c 154<\/li>\n<li>The &#8216;pixels&#8217; pointer. Check lines: 1482, 1508. psd-load.c 1482<\/li>\n<li>The &#8216;img_a-&gt;alpha_names&#8217; pointer. Check lines: 1735, 1741. psd-load.c 1735<\/li>\n<li>The &#8216;brush&#8217; pointer. Check lines: 432, 451. brush.c 432<\/li>\n<li>The &#8216;curve_list-&gt;data&#8217; pointer. Check lines: 126, 129. curve.c 126<\/li>\n<li>The &#8216;outline_list-&gt;data&#8217; pointer. Check lines: 183, 187. pxl-outline.c 183<\/li>\n<li>The &#8216;id_ptr&#8217; pointer. Check lines: 896, 898. sample-colorize.c 896<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0422\u0440\u0443\u0434\u043d\u043e \u0441\u0443\u0434\u0438\u0442\u044c \u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u041c\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e.<\/p>\n<p>  \u0425\u043e\u0442\u044f, \u043a\u0430\u043a \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u043c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 GIMP, \u044f \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443. \u041d\u0435\u043c\u0430\u043b\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u043a \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432 GIMP. \u0421\u043f\u0430\u0441\u0438\u0431\u043e.<\/p>\n<h2>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Andrey Karpov. <a href=\"http:\/\/www.viva64.com\/en\/b\/0273\/\">Checking GIMP&#8217;s Source Code with PVS-Studio<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441?<\/b><\/p>\n<div class=\"spoiler_text\">\u0427\u0430\u0441\u0442\u043e \u043a \u043d\u0430\u0448\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0437\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043d\u0438\u0445 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/www.viva64.com\/ru\/a\/0085\/\">\u041e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e PVS-Studio \u0438 CppCat, \u0432\u0435\u0440\u0441\u0438\u044f 2014<\/a>. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c.  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/233489\/\"> http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/233489\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/154\/ac2\/0a2\/154ac20a216b5651b77a964d42d24544.png\" alt=\"PVS-Studio and GIMP\" align=\"left\"\/><br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c GIMP, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0430\u0441\u044c. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439, \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u0435\u043d\u044c \u0431\u044b\u043b\u0430 \u043f\u043e\u0431\u0435\u0436\u0434\u0435\u043d\u0430, \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-233489","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233489"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/233489\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}