Coverity-updates archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New Defects reported by Coverity Scan for NetBSD-i386-user



Hi,

Please find the latest report on new defect(s) introduced to NetBSD-i386-user found with Coverity Scan.

59 new defect(s) introduced to NetBSD-i386-user found with Coverity Scan.
15 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 59 defect(s)


** CID 401310:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/dlist.c: 7220 in save_SamplerParameterf()

** CID 401311:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/dlist.c: 7189 in save_SamplerParameteri()

** CID 401312:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/querymatrix.c: 125 in _es_QueryMatrixxOES()

** CID 401356:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/imports.c: 585 in _mesa_float_to_half()

** CID 401357:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 2215 in _mesa_texstore_unorm88()
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 2226 in _mesa_texstore_unorm88()

** CID 401359:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/swrast/s_drawpix.c: 549 in draw_rgba_pixels()

** CID 401401:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/swrast/s_texrender.c: 637 in _swrast_render_texture()

** CID 401402:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/swrast/s_triangle.c: 1052 in _swrast_choose_triangle()

** CID 401412:  Missing break in switch  (MISSING_BREAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/get.c: 1961 in _mesa_GetBooleanv()

** CID 401416:  Missing break in switch  (MISSING_BREAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/get.c: 2323 in _mesa_GetDoublev()

** CID 401420:  Missing break in switch  (MISSING_BREAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/get.c: 2048 in _mesa_GetFloatv()

** CID 401436:  Macro compares unsigned to 0  (NO_EFFECT)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 3983 in _mesa_texstore_rgba_uint16()

** CID 401437:  Macro compares unsigned to 0  (NO_EFFECT)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 3920 in _mesa_texstore_rgba_uint8()

** CID 401548:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/mipmap.c: 2067 in generate_mipmap_compressed()

** CID 401698:  Explicit null dereferenced  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c: 708 in get_readers_for_single_write()

** CID 401707:  Improper use of negative value  (NEGATIVE_RETURNS)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_variable.c: 103 in rc_variable_change_dst()
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_variable.c: 111 in rc_variable_change_dst()
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_variable.c: 88 in rc_variable_change_dst()

** CID 401722:  Dereference before null check  (REVERSE_INULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c: 400 in build_loop_info()

** CID 401742:  Unused value  (UNUSED_VALUE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c: 702 in convert_rgb_to_alpha()

** CID 500066:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/pack.c: 3540 in _mesa_unpack_color_span_chan()

** CID 714289:  Copy-paste error  (COPY_PASTE_ERROR)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c: 950 in r300_transform_trig_simple()


________________________________________________________________________________________________________
*** CID 401310:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/dlist.c: 7220 in save_SamplerParameterf()
7214        }
7215     }
7216     
7217     static void GLAPIENTRY
7218     save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
7219     {
>>>     CID 401310:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
>>>     Taking address with "&param" yields a singleton pointer.
7220        save_SamplerParameterfv(sampler, pname, &param);
7221     }
7222     
7223     static void GLAPIENTRY
7224     save_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
7225     {

________________________________________________________________________________________________________
*** CID 401311:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/dlist.c: 7189 in save_SamplerParameteri()
7183        }
7184     }
7185     
7186     static void GLAPIENTRY
7187     save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
7188     {
>>>     CID 401311:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
>>>     Taking address with "&param" yields a singleton pointer.
7189        save_SamplerParameteriv(sampler, pname, &param);
7190     }
7191     
7192     static void GLAPIENTRY
7193     save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
7194     {

________________________________________________________________________________________________________
*** CID 401312:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/querymatrix.c: 125 in _es_QueryMatrixxOES()
119             {GL_TEXTURE, GL_TEXTURE_MATRIX},
120         };
121     
122         /* Call Mesa to get the current matrix in floating-point form.  First,
123          * we have to figure out what the current matrix mode is.
124          */
>>>     CID 401312:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
>>>     Taking address with "&tmp" yields a singleton pointer.
125         _mesa_GetIntegerv(GL_MATRIX_MODE, &tmp);
126         currentMode = (GLenum) tmp;
127     
128         /* The mode is either GL_FALSE, if for some reason we failed to query
129          * the mode, or a given mode from the above table.  Search for the
130          * returned mode to get the desired matrix; if we don't find it,

________________________________________________________________________________________________________
*** CID 401356:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/imports.c: 585 in _mesa_float_to_half()
579           }
580           else if (new_exp < -14) {
581              /* this maps to a denorm */
582              unsigned int exp_val = (unsigned int) (-14 - new_exp); /* 2^-exp_val*/
583              e = 0;
584              switch (exp_val) {
>>>     CID 401356:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this statement "case 0U:".
585                 case 0:
586                    _mesa_warning(NULL,
587                        "float_to_half: logical error in denorm creation!\n");
588                    /* m = 0; - already set */
589                    break;
590                 case 1: m = 512 + (flt_m >> 14); break;

________________________________________________________________________________________________________
*** CID 401357:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 2215 in _mesa_texstore_unorm88()
2209     	    can_swizzle(srcFormat)) {
2210           GLubyte dstmap[4];
2211     
2212           /* dstmap - how to swizzle from RGBA to dst format:
2213            */
2214           if (dstFormat == MESA_FORMAT_AL88 || dstFormat == MESA_FORMAT_AL88_REV) {
>>>     CID 401357:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this expression "dstFormat == 18U" inside statement "if ((littleEndian && dstFor...".
2215     	 if ((littleEndian && dstFormat == MESA_FORMAT_AL88) ||
2216     	     (!littleEndian && dstFormat == MESA_FORMAT_AL88_REV)) {
2217     	    dstmap[0] = 0;
2218     	    dstmap[1] = 3;
2219     	 }
2220     	 else {
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 2226 in _mesa_texstore_unorm88()
2220     	 else {
2221     	    dstmap[0] = 3;
2222     	    dstmap[1] = 0;
2223     	 }
2224           }
2225           else {
>>>     CID 401357:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this expression "dstFormat == 33U" inside statement "if ((littleEndian && dstFor...".
2226     	 if ((littleEndian && dstFormat == MESA_FORMAT_RG88) ||
2227     	     (!littleEndian && dstFormat == MESA_FORMAT_RG88_REV)) {
2228     	    dstmap[0] = 0;
2229     	    dstmap[1] = 1;
2230     	 }
2231     	 else {

________________________________________________________________________________________________________
*** CID 401359:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/swrast/s_drawpix.c: 549 in draw_rgba_pixels()
543     
544           /* XXX this is ugly/temporary, to undo above change */
545           span.array->ChanType = CHAN_TYPE;
546        }
547     
548        if (convImage) {
>>>     CID 401359:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this statement "free(convImage);".
549           free(convImage);
550        }
551     }
552     
553     
554     /**

________________________________________________________________________________________________________
*** CID 401401:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/swrast/s_texrender.c: 637 in _swrast_render_texture()
631     _swrast_render_texture(struct gl_context *ctx,
632                            struct gl_framebuffer *fb,
633                            struct gl_renderbuffer_attachment *att)
634     {
635        (void) fb;
636     
>>>     CID 401401:  Dereference after null check  (FORWARD_NULL)
>>>     Comparing "att->Renderbuffer" to null implies that "att->Renderbuffer" might be null.
637        if (!att->Renderbuffer) {
638           wrap_texture(ctx, att);
639        }
640        update_wrapper(ctx, att);
641     }
642     

________________________________________________________________________________________________________
*** CID 401402:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/swrast/s_triangle.c: 1052 in _swrast_choose_triangle()
1046              format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE;
1047              minFilter = texObj2D ? texObj2D->Sampler.MinFilter : GL_NONE;
1048              magFilter = texObj2D ? texObj2D->Sampler.MagFilter : GL_NONE;
1049              envMode = ctx->Texture.Unit[0].EnvMode;
1050     
1051              /* First see if we can use an optimized 2-D texture function */
>>>     CID 401402:  Dereference after null check  (FORWARD_NULL)
>>>     Dereferencing null pointer "texImg".
1052              if (ctx->Texture._EnabledCoordUnits == 0x1
1053                  && !ctx->FragmentProgram._Current
1054                  && !ctx->ATIFragmentShader._Enabled
1055                  && ctx->Texture._EnabledUnits == 0x1
1056                  && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
1057                  && texObj2D->Sampler.WrapS == GL_REPEAT

________________________________________________________________________________________________________
*** CID 401412:  Missing break in switch  (MISSING_BREAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/get.c: 1961 in _mesa_GetBooleanv()
1955           params[3] = INT_TO_BOOLEAN(((GLint *) p)[3]);
1956        case TYPE_INT_3:
1957           params[2] = INT_TO_BOOLEAN(((GLint *) p)[2]);
1958        case TYPE_INT_2:
1959        case TYPE_ENUM_2:
1960           params[1] = INT_TO_BOOLEAN(((GLint *) p)[1]);
>>>     CID 401412:  Missing break in switch  (MISSING_BREAK)
>>>     The above case falls through to this one.
1961        case TYPE_INT:
1962        case TYPE_ENUM:
1963           params[0] = INT_TO_BOOLEAN(((GLint *) p)[0]);
1964           break;
1965     
1966        case TYPE_INT_N:

________________________________________________________________________________________________________
*** CID 401416:  Missing break in switch  (MISSING_BREAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/get.c: 2323 in _mesa_GetDoublev()
2317           params[3] = ((GLint *) p)[3];
2318        case TYPE_INT_3:
2319           params[2] = ((GLint *) p)[2];
2320        case TYPE_INT_2:
2321        case TYPE_ENUM_2:
2322           params[1] = ((GLint *) p)[1];
>>>     CID 401416:  Missing break in switch  (MISSING_BREAK)
>>>     The above case falls through to this one.
2323        case TYPE_INT:
2324        case TYPE_ENUM:
2325           params[0] = ((GLint *) p)[0];
2326           break;
2327     
2328        case TYPE_INT_N:

________________________________________________________________________________________________________
*** CID 401420:  Missing break in switch  (MISSING_BREAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/get.c: 2048 in _mesa_GetFloatv()
2042           params[3] = (GLfloat) (((GLint *) p)[3]);
2043        case TYPE_INT_3:
2044           params[2] = (GLfloat) (((GLint *) p)[2]);
2045        case TYPE_INT_2:
2046        case TYPE_ENUM_2:
2047           params[1] = (GLfloat) (((GLint *) p)[1]);
>>>     CID 401420:  Missing break in switch  (MISSING_BREAK)
>>>     The above case falls through to this one.
2048        case TYPE_INT:
2049        case TYPE_ENUM:
2050           params[0] = (GLfloat) (((GLint *) p)[0]);
2051           break;
2052     
2053        case TYPE_INT_N:

________________________________________________________________________________________________________
*** CID 401436:  Macro compares unsigned to 0  (NO_EFFECT)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 3983 in _mesa_texstore_rgba_uint16()
3977                 + dstYoffset * dstRowStride
3978                 + dstXoffset * texelBytes;
3979              for (row = 0; row < srcHeight; row++) {
3980                 GLushort *dstTexel = (GLushort *) dstRow;
3981                 GLint i;
3982                 for (i = 0; i < srcWidth * components; i++) {
>>>     CID 401436:  Macro compares unsigned to 0  (NO_EFFECT)
>>>     This less-than-zero comparison of an unsigned value is never true. "src[i] < 0U".
3983                    dstTexel[i] = (GLushort) CLAMP(src[i], 0, 0xffff);
3984                 }
3985                 dstRow += dstRowStride;
3986                 src += srcWidth * components;
3987              }
3988           }

________________________________________________________________________________________________________
*** CID 401437:  Macro compares unsigned to 0  (NO_EFFECT)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/texstore.c: 3920 in _mesa_texstore_rgba_uint8()
3914                 + dstYoffset * dstRowStride
3915                 + dstXoffset * texelBytes;
3916              for (row = 0; row < srcHeight; row++) {
3917                 GLubyte *dstTexel = (GLubyte *) dstRow;
3918                 GLint i;
3919                 for (i = 0; i < srcWidth * components; i++) {
>>>     CID 401437:  Macro compares unsigned to 0  (NO_EFFECT)
>>>     This less-than-zero comparison of an unsigned value is never true. "src[i] < 0U".
3920                    dstTexel[i] = (GLubyte) CLAMP(src[i], 0, 0xff);
3921                 }
3922                 dstRow += dstRowStride;
3923                 src += srcWidth * components;
3924              }
3925           }

________________________________________________________________________________________________________
*** CID 401548:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/mipmap.c: 2067 in generate_mipmap_compressed()
2061           }
2062     
2063           /* get dest gl_texture_image */
2064           dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
2065           if (!dstImage) {
2066              _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
>>>     CID 401548:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "temp_dst" going out of scope leaks the storage it points to.
2067              return;
2068           }
2069     
2070           _mesa_generate_mipmap_level(target, datatype, comps, border,
2071                                       srcWidth, srcHeight, srcDepth,
2072                                       temp_src, temp_src_stride / components,

________________________________________________________________________________________________________
*** CID 401698:  Explicit null dereferenced  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c: 708 in get_readers_for_single_write()
702     	memset(d->BranchMasks, 0, sizeof(d->BranchMasks));
703     
704     	if (!dst_mask)
705     		return;
706     
707     	for(tmp = writer->Next; tmp != &d->C->Program.Instructions;
>>>     CID 401698:  Explicit null dereferenced  (FORWARD_NULL)
>>>     Dereferencing null pointer "tmp".
708     							tmp = tmp->Next){
709     		rc_opcode opcode = rc_get_flow_control_inst(tmp);
710     		switch(opcode) {
711     		case RC_OPCODE_BGNLOOP:
712     			d->ReaderData->LoopDepth++;
713     			push_branch_mask(d, &branch_depth);

________________________________________________________________________________________________________
*** CID 401707:  Improper use of negative value  (NEGATIVE_RETURNS)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_variable.c: 103 in rc_variable_change_dst()
97     				/* Reuse the source index of the source that
98     				 * was just deleted and set its register
99     				 * index.  We can't use rc_pair_alloc_source
100     				 * for this becuase it might return a source
101     				 * index that is already being used. */
102     				if (src_type & RC_SOURCE_RGB) {
>>>     CID 401707:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Using variable "src_index" as an index to array "pair_inst->RGB.Src".
103     					pair_inst->RGB.Src[src_index]
104     						.Used =	1;
105     					pair_inst->RGB.Src[src_index]
106     						.Index = new_index;
107     					pair_inst->RGB.Src[src_index]
108     						.File = RC_FILE_TEMPORARY;
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_variable.c: 111 in rc_variable_change_dst()
105     					pair_inst->RGB.Src[src_index]
106     						.Index = new_index;
107     					pair_inst->RGB.Src[src_index]
108     						.File = RC_FILE_TEMPORARY;
109     				}
110     				if (src_type & RC_SOURCE_ALPHA) {
>>>     CID 401707:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Using variable "src_index" as an index to array "pair_inst->Alpha.Src".
111     					pair_inst->Alpha.Src[src_index]
112     						.Used = 1;
113     					pair_inst->Alpha.Src[src_index]
114     						.Index = new_index;
115     					pair_inst->Alpha.Src[src_index]
116     						.File = RC_FILE_TEMPORARY;
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_variable.c: 88 in rc_variable_change_dst()
82     							&reader->Inst->U.P;
83     			unsigned int src_type = rc_source_type_swz(
84     							reader->U.P.Arg->Swizzle);
85     
86     			int src_index = reader->U.P.Arg->Source;
87     			if (src_index == RC_PAIR_PRESUB_SRC) {
>>>     CID 401707:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "src_index" = "rc_pair_get_src_index(struct rc_pair_instruction *, struct rc_pair_instruction_source *)".
88     				src_index = rc_pair_get_src_index(
89     						pair_inst, reader->U.P.Src);
90     			}
91     			/* Try to delete the old src, it is OK if this fails,
92     			 * because rc_pair_alloc_source might be able to
93     			 * find a source the ca be reused.

________________________________________________________________________________________________________
*** CID 401722:  Dereference before null check  (REVERSE_INULL)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c: 400 in build_loop_info()
394     		case RC_OPCODE_ENDLOOP:
395     			loop->EndLoop = ptr;
396     			break;
397     		}
398     	}
399     
>>>     CID 401722:  Dereference before null check  (REVERSE_INULL)
>>>     Null-checking "loop->BeginLoop" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
400     	if (loop->BeginLoop && loop->Brk && loop->If && loop->EndIf
401     					&& loop->Cond && loop->EndLoop) {
402     		return 1;
403     	}
404     	return 0;
405     }

________________________________________________________________________________________________________
*** CID 401742:  Unused value  (UNUSED_VALUE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c: 702 in convert_rgb_to_alpha()
696     					RC_FILE_TEMPORARY,
697     					pair_inst->RGB.DestIndex,
698     					rc_mask_to_swizzle(old_mask));
699     			new_index = i;
700     			*new_regvalp = *old_regvalp;
701     			*old_regvalp = NULL;
>>>     CID 401742:  Unused value  (UNUSED_VALUE)
>>>     Pointer "new_regvalp" returned by "get_reg_valuep(s, RC_FILE_TEMPORARY, i, 3U)" is never used.
702     			new_regvalp = get_reg_valuep(s, RC_FILE_TEMPORARY, i, 3);
703     			break;
704     		}
705     	}
706     	if (new_index < 0) {
707     		return 0;

________________________________________________________________________________________________________
*** CID 500066:  Logically dead code  (DEADCODE)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/main/pack.c: 3540 in _mesa_unpack_color_span_chan()
3534           }
3535           /*
3536            * Common situation, loading 8bit RGBA/RGB source images
3537            * into 16/32 bit destination. (OSMesa16/32)
3538            */
3539           else if (srcType == GL_UNSIGNED_BYTE) {
>>>     CID 500066:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this statement "if (dstFormat == 6408U){
  ...".
3540              if (dstFormat == GL_RGBA) {
3541                 if (srcFormat == GL_RGB) {
3542                    GLuint i;
3543                    const GLubyte *src = (const GLubyte *) source;
3544                    GLchan *dst = dest;
3545                    for (i = 0; i < n; i++) {

________________________________________________________________________________________________________
*** CID 714289:  Copy-paste error  (COPY_PASTE_ERROR)
/home/phil/cov/xsrc/external/mit/MesaLib7/dist/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c: 950 in r300_transform_trig_simple()
944     			negate(swizzle_zzzz(srcreg(RC_FILE_CONSTANT, constants[0]))));
945     
946     		sin_approx(c, inst, inst->U.I.DstReg,
947     			swizzle_wwww(srcreg(RC_FILE_TEMPORARY, tempreg)),
948     			constants);
949     	} else if (inst->U.I.Opcode == RC_OPCODE_SIN) {
>>>     CID 714289:  Copy-paste error  (COPY_PASTE_ERROR)
>>>     "swizzle_xxxx" in "swizzle_xxxx(inst->U.I.SrcReg[0])" looks like a copy-paste error.  Should it say "swizzle_yyyy" instead?
950     		emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W),
951     			swizzle_xxxx(inst->U.I.SrcReg[0]),
952     			swizzle_zzzz(srcreg(RC_FILE_CONSTANT, constants[1])),
953     			swizzle_yyyy(srcreg(RC_FILE_CONSTANT, constants[1])));
954     		emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W),
955     			swizzle_wwww(srcreg(RC_FILE_TEMPORARY, tempreg)));


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/1448?tab=overview

To manage Coverity Scan email notifications for "coverity-updates%netbsd.org@localhost", click http://scan.coverity.com/subscriptions/edit?email=coverity-updates%40netbsd.org&token=487286ca1a9a4f4bd485d16f66b5e782 .



Home | Main Index | Thread Index | Old Index