logical AND with Constant is not logically correct

Bug #1472523 reported by Garima
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmng (Ubuntu)
New
Undecided
Unassigned

Bug Description

libmng version: 2.0.3

In file libmng_pixels.c, there are many functions; those are performing bit format conversion (8bit format to 16 bit, 16bit to 8bit etc.). For format conversion function are doing logical ANDing with Constant that is not logically correct.

e.g. At #15692: *(pDstline+1) = (mng_uint8)(iR && 0xFF);

In above example due to Logical ANDing(&&) in place of bitwise ANDing(&) there is a loss of information stored in LSB’s of iR.

Now, Replaced logical ANDing operator (&&) with bitwise ANDing operator(&)

After correction:

At #15692: *(pDstline+1) = (mng_uint8)(iR & 0xFF);

Many similar changes are applied in libmng_pixel.c, For detail information please check the attached patch file.

Tags: patch
Revision history for this message
Garima (garima-g) wrote :
Garima (garima-g)
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "libmng_pixels.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.