diff mbox

[FFmpeg-devel,5/7] avcodec/h263dec: Return the correct error code in explode mode

Message ID 20161215202113.20807-5-michael@niedermayer.cc
State Accepted
Commit eb7aa6bde42c01a472e67a3ab8fbf14e158cd3cc
Headers show

Commit Message

Michael Niedermayer Dec. 15, 2016, 8:21 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/h263dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Dec. 15, 2016, 8:35 p.m. UTC | #1
On 12/15/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/h263dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index d0da1d31c1..75fc688e78 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -713,7 +713,7 @@ frame_end:
>      }
>
>      if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
> -        return ret;
> +        return slice_ret;
>      else
>          return get_consumed_bytes(s, buf_size);
>  }
> --
> 2.11.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

lgtm
Michael Niedermayer Dec. 15, 2016, 9:28 p.m. UTC | #2
On Thu, Dec 15, 2016 at 09:35:54PM +0100, Paul B Mahol wrote:
> On 12/15/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/h263dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> > index d0da1d31c1..75fc688e78 100644
> > --- a/libavcodec/h263dec.c
> > +++ b/libavcodec/h263dec.c
> > @@ -713,7 +713,7 @@ frame_end:
> >      }
> >
> >      if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
> > -        return ret;
> > +        return slice_ret;
> >      else
> >          return get_consumed_bytes(s, buf_size);
> >  }
> > --
> > 2.11.0
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> lgtm

applied

thx

[...]
wm4 Dec. 16, 2016, 4:19 p.m. UTC | #3
On Thu, 15 Dec 2016 21:21:11 +0100
Michael Niedermayer <michael@niedermayer.cc> wrote:

> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/h263dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index d0da1d31c1..75fc688e78 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -713,7 +713,7 @@ frame_end:
>      }
>  
>      if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
> -        return ret;
> +        return slice_ret;
>      else
>          return get_consumed_bytes(s, buf_size);
>  }

Isn't there significant risk of running into endless loops with 0 bytes
decoded in patches like this? (Not sure if it can happen in this
specific case.) Seems quite questionable for a feature that will
probably be deprecated (truncated mode decoding).
diff mbox

Patch

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index d0da1d31c1..75fc688e78 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -713,7 +713,7 @@  frame_end:
     }
 
     if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
-        return ret;
+        return slice_ret;
     else
         return get_consumed_bytes(s, buf_size);
 }