diff mbox

[FFmpeg-devel,04/12,v2] scpr: Added missing error check

Message ID 20170706185037.3323-1-derek.buitenhuis@gmail.com
State Accepted
Commit f7daed854532628c5e83fb7a5da04ae8916379ff
Headers show

Commit Message

Derek Buitenhuis July 6, 2017, 6:50 p.m. UTC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavcodec/scpr.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paul B Mahol July 6, 2017, 8:32 p.m. UTC | #1
On 7/6/17, Derek Buitenhuis <derek.buitenhuis@gmail.com> wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  libavcodec/scpr.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
> index f6d1e45692..37fbe7a106 100644
> --- a/libavcodec/scpr.c
> +++ b/libavcodec/scpr.c
> @@ -582,6 +582,8 @@ static int decompress_p(AVCodecContext *avctx,
>
>                  for (; by < y * 16 + sy2 && by < avctx->height;) {
>                      ret = decode_value(s, s->op_model[ptype], 6, 1000,
> &ptype);
> +                    if (ret < 0)
> +                        return ret;
>                      if (ptype == 0) {
>                          ret = decode_unit(s, &s->pixel_model[0][cx + cx1],
> 400, &r);
>                          if (ret < 0)
> --
> 2.11.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

ok
diff mbox

Patch

diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index f6d1e45692..37fbe7a106 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -582,6 +582,8 @@  static int decompress_p(AVCodecContext *avctx,
 
                 for (; by < y * 16 + sy2 && by < avctx->height;) {
                     ret = decode_value(s, s->op_model[ptype], 6, 1000, &ptype);
+                    if (ret < 0)
+                        return ret;
                     if (ptype == 0) {
                         ret = decode_unit(s, &s->pixel_model[0][cx + cx1], 400, &r);
                         if (ret < 0)