]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/truemotion2.c
avcodec/mpc8: check for overread first
[ffmpeg] / libavcodec / truemotion2.c
index f077f0e4bd9905e8024f08c6b4bac02b9c929e56..97c38f7f088d275697c13ab308be15e15a97fec7 100644 (file)
@@ -441,8 +441,8 @@ static inline int GET_TOK(TM2Context *ctx,int type)
 
 /* recalculate last and delta values for next blocks */
 #define TM2_RECALC_BLOCK(CHR, stride, last, CD) {\
-    CD[0] = CHR[1] - last[1];\
-    CD[1] = (int)CHR[stride + 1] - (int)CHR[1];\
+    CD[0] = (unsigned)CHR[         1] - (unsigned)last[1];\
+    CD[1] = (unsigned)CHR[stride + 1] - (unsigned) CHR[1];\
     last[0] = (int)CHR[stride + 0];\
     last[1] = (int)CHR[stride + 1];}