[haiku-commits] Re: haiku: hrev50084 - src/add-ons/media/media-add-ons/video_mixer

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 14 Feb 2016 21:12:30 +0100

On Sun, Feb 14, 2016 at 08:59:12PM +0100, Axel Dörfler wrote:

On 02/13/2016 05:02 PM, b.vitruvio@xxxxxxxxx wrote:
-            *(destination) = ALPHABLEND(c1, *destination, alpha);
-            *(destination+1) = ALPHABLEND(c2, *destination, alpha);
-            *(destination+2) = ALPHABLEND(c3, *destination, alpha);
-            *(destination+3) = 0x00;
+            destination[0] = ALPHABLEND(c1, destination[0], alpha);
+            destination[1] = ALPHABLEND(c2, destination[1], alpha);
+            destination[2] = ALPHABLEND(c3, destination[2], alpha);

I hope you noticed that this actually changes the meaning of the code?
If you did that, and your version is now correct (which means that it wasn't
before), it should have been part of the commit message.

It fixes a regression introduced by Barrett's previous commit on the
same piece of code.

The original code used *(destination++) = ... *destination ...; which is
undefined behavior.

-- 
Adrien.

Other related posts: