[2/5] cinepak: simplify, use FFMIN()

Message ID 1321608503-56938-2-git-send-email-martin@martin.st
State Committed
Commit a2b51fe87c49c3ce21c4ae3310be234a9f87795c
Headers show

Commit Message

Martin Storsjö Nov. 18, 2011, 9:28 a.m.
From: Michael Niedermayer <michaelni@gmx.at>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavcodec/cinepak.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Kostya Shishkov Nov. 18, 2011, 9:33 a.m. | #1
On Fri, Nov 18, 2011 at 11:28:20AM +0200, Martin Storsjö wrote:
> From: Michael Niedermayer <michaelni@gmx.at>
> 
> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> ---
>  libavcodec/cinepak.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
> index 0dbdeab..c6edfe6 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)
> -- 

looks OK

Patch

diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 0dbdeab..c6edfe6 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)