diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 0dbdeab3545d7b019b816b5b2f908199bbc6c331..c6edfe6cc945e51bdeeaf89fd7a6364e59d5abbe 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -357,8 +357,7 @@ static int cinepak_decode (CinepakContext *s)
 
     s->data += 10 + s->sega_film_skip_bytes;
 
-    if (num_strips > MAX_STRIPS)
-        num_strips = MAX_STRIPS;
+    num_strips = FFMIN(num_strips, MAX_STRIPS);
 
     for (i=0; i < num_strips; i++) {
         if ((s->data + 12) > eod)