[5/5] cinepak: remove redundant coordinate checks

Message ID 1321608892-57655-3-git-send-email-martin@martin.st
State Committed
Commit a4009c6a9adc9ea38eb56967b6a5e933451ae545
Headers show

Commit Message

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

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

Comments

Kostya Shishkov Nov. 18, 2011, 9:44 a.m. | #1
On Fri, Nov 18, 2011 at 11:34:52AM +0200, Martin Storsjö wrote:
> From: Michael Niedermayer <michaelni@gmx.at>
> 
> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> ---
>  libavcodec/cinepak.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
> index a858d6e..8ae1bb3 100644
> --- a/libavcodec/cinepak.c
> +++ b/libavcodec/cinepak.c
> @@ -269,8 +269,8 @@ static int cinepak_decode_strip (CinepakContext *s,
>      int      chunk_id, chunk_size;
>  
>      /* coordinate sanity checks */
> -    if (strip->x1 >= s->width  || strip->x2 > s->width  ||
> -        strip->y1 >= s->height || strip->y2 > s->height ||
> +    if (strip->x2 > s->width   ||
> +        strip->y2 > s->height  ||
>          strip->x1 >= strip->x2 || strip->y1 >= strip->y2)
>          return -1;
>  
> -- 

probably OK

Patch

diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index a858d6e..8ae1bb3 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -269,8 +269,8 @@  static int cinepak_decode_strip (CinepakContext *s,
     int      chunk_id, chunk_size;
 
     /* coordinate sanity checks */
-    if (strip->x1 >= s->width  || strip->x2 > s->width  ||
-        strip->y1 >= s->height || strip->y2 > s->height ||
+    if (strip->x2 > s->width   ||
+        strip->y2 > s->height  ||
         strip->x1 >= strip->x2 || strip->y1 >= strip->y2)
         return -1;