diff mbox

[FFmpeg-devel,1/2] avcodec/clearvideo: Do not loose the return code of decode_mb()

Message ID 20170330201213.15861-1-michael@niedermayer.cc
State Accepted
Commit fe46d92c15ca7bd35324ff667c433a06af8b845c
Headers show

Commit Message

Michael Niedermayer March 30, 2017, 8:12 p.m. UTC
Fixes CID1401671

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/clearvideo.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Paul B Mahol March 30, 2017, 8:15 p.m. UTC | #1
On 3/30/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes CID1401671
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/clearvideo.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>

Whatever, lgtm.
Nicolas George March 30, 2017, 8:20 p.m. UTC | #2
Le decadi 10 germinal, an CCXXV, Michael Niedermayer a écrit :
> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/clearvideo: Do not loose the

Lose, single O.

To lose means you do not know where something is.

To loose means to set free, as in "the Forsaken are loose".

Maybe a pre-commit / patcheck hook for that? I do not know how it works.

Regards,
Michael Niedermayer March 30, 2017, 9:11 p.m. UTC | #3
On Thu, Mar 30, 2017 at 10:20:13PM +0200, Nicolas George wrote:
> Le decadi 10 germinal, an CCXXV, Michael Niedermayer a écrit :
> > Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/clearvideo: Do not loose the
> 
> Lose, single O.

fixed, applied

thx


> 
> To lose means you do not know where something is.
> 
> To loose means to set free, as in "the Forsaken are loose".
> 

> Maybe a pre-commit / patcheck hook for that? I do not know how it works.

agree, might make sense if someone wants to implement that

thx

[...]
Moritz Barsnick April 1, 2017, 6:28 p.m. UTC | #4
On Thu, Mar 30, 2017 at 22:20:13 +0200, Nicolas George wrote:
> To loose means to set free, as in "the Forsaken are loose".

Actually no: "loose" is an adjective. The verb would be "to loosen"
(e.g. a leash, a rope around your neck, ... ;-)).

Nitpicking,
Moritz
diff mbox

Patch

diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index e2644e3090..437c459aa5 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -281,6 +281,7 @@  static int clv_decode_frame(AVCodecContext *avctx, void *data,
     uint32_t frame_type;
     int i, j;
     int ret;
+    int mb_ret = 0;
 
     bytestream2_init(&gb, buf, buf_size);
     if (avctx->codec_tag == MKTAG('C','L','V','1')) {
@@ -312,7 +313,9 @@  static int clv_decode_frame(AVCodecContext *avctx, void *data,
 
         for (j = 0; j < c->mb_height; j++) {
             for (i = 0; i < c->mb_width; i++) {
-                ret |= decode_mb(c, i, j);
+                ret = decode_mb(c, i, j);
+                if (ret < 0)
+                    mb_ret = ret;
             }
         }
     } else {
@@ -323,7 +326,7 @@  static int clv_decode_frame(AVCodecContext *avctx, void *data,
 
     *got_frame = 1;
 
-    return ret < 0 ? ret : buf_size;
+    return mb_ret < 0 ? mb_ret : buf_size;
 }
 
 static av_cold int clv_decode_init(AVCodecContext *avctx)