[3/5] cinepak, simplify, use AV_RB24()

Message ID 1321608892-57655-1-git-send-email-martin@martin.st
State Committed
Commit d92fea2b1420aea1c1f3c2ececbd953f5f06f49b
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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Kostya Shishkov Nov. 18, 2011, 9:43 a.m. | #1
On Fri, Nov 18, 2011 at 11:34:50AM +0200, Martin Storsjö wrote:
> From: Michael Niedermayer <michaelni@gmx.at>
> 
> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
> ---
>  libavcodec/cinepak.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
> index c6edfe6..e66a1c0 100644
> --- a/libavcodec/cinepak.c
> +++ b/libavcodec/cinepak.c
> @@ -326,7 +326,7 @@ static int cinepak_decode (CinepakContext *s)
>  
>      frame_flags = s->data[0];
>      num_strips  = AV_RB16 (&s->data[8]);
> -    encoded_buf_size = ((s->data[1] << 16) | AV_RB16 (&s->data[2]));
> +    encoded_buf_size = AV_RB24(&s->data[1]);
>  
>      /* if this is the first frame, check for deviant Sega FILM data */
>      if (s->sega_film_skip_bytes == -1) {
> -- 

OK

Patch

diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index c6edfe6..e66a1c0 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -326,7 +326,7 @@  static int cinepak_decode (CinepakContext *s)
 
     frame_flags = s->data[0];
     num_strips  = AV_RB16 (&s->data[8]);
-    encoded_buf_size = ((s->data[1] << 16) | AV_RB16 (&s->data[2]));
+    encoded_buf_size = AV_RB24(&s->data[1]);
 
     /* if this is the first frame, check for deviant Sega FILM data */
     if (s->sega_film_skip_bytes == -1) {