diff mbox

[FFmpeg-devel,2/2] avcodec/hevcdec: Use error path if init_get_bits8() fails

Message ID 20170624124618.32387-2-michael@niedermayer.cc
State Accepted
Commit 2476067680334b147f72930a5e7c3ad7668de4a8
Headers show

Commit Message

Michael Niedermayer June 24, 2017, 12:46 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/hevcdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol June 24, 2017, 2:25 p.m. UTC | #1
On 6/24/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/hevcdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

lgtm
Michael Niedermayer June 24, 2017, 7:51 p.m. UTC | #2
On Sat, Jun 24, 2017 at 04:25:17PM +0200, Paul B Mahol wrote:
> On 6/24/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/hevcdec.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> 
> lgtm

patchset applied

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 83130fc48f..f4114fd993 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2419,9 +2419,9 @@  static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
 
     if(ctb_row) {
         ret = init_get_bits8(&lc->gb, s->data + s->sh.offset[ctb_row - 1], s->sh.size[ctb_row - 1]);
-
         if (ret < 0)
-            return ret;
+            goto error;
+
         ret = ff_init_cabac_decoder(&lc->cc, s->data + s->sh.offset[(ctb_row)-1], s->sh.size[ctb_row - 1]);
         if (ret < 0)
             goto error;