[MPlayer-cvslog] r37758 - trunk/libmpcodecs/vf_divtc.c

reimar subversion at mplayerhq.hu
Sat Feb 20 12:34:10 CET 2016


Author: reimar
Date: Sat Feb 20 12:34:10 2016
New Revision: 37758

Log:
vf_divtc.c: Ensure shift is always valid.

Not sure if this can actually happen, and if
it might impact performance (on x86 the compiler
should optimize the "and" away anyway).
Just thinking it might be safer, and it avoids
a Coverity warning.

Modified:
   trunk/libmpcodecs/vf_divtc.c

Modified: trunk/libmpcodecs/vf_divtc.c
==============================================================================
--- trunk/libmpcodecs/vf_divtc.c	Sat Feb 20 12:32:40 2016	(r37757)
+++ trunk/libmpcodecs/vf_divtc.c	Sat Feb 20 12:34:10 2016	(r37758)
@@ -168,7 +168,7 @@ static unsigned int checksum_plane(unsig
       t=be2me_32(wsum);
 #endif
 
-      for(sum^=(t<<shift|t>>(32-shift)); p<e;)
+      for(sum^=(t<<shift|t>>((32-shift)&31)); p<e;)
          sum^=*p++<<(shift=(shift-8)&31);
       }
 


More information about the MPlayer-cvslog mailing list