One more use for FFMIN.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 31 May 2009 10:44:42 +0000 (10:44 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 31 May 2009 10:44:42 +0000 (10:44 +0000)
Originally committed as revision 19055 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/lcldec.c

index 927f77b..5225ff0 100644 (file)
@@ -102,9 +102,7 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
             cnt = (ofs >> 11) + 1;
             ofs &= 0x7ff;
             cnt *= 4;
-            if (destptr_end - destptr < cnt) {
-                cnt =  destptr_end - destptr;
-            }
+            cnt = FFMIN(cnt, destptr_end - destptr);
             av_memcpy_backptr(destptr, ofs, cnt);
             destptr += cnt;
         }