avcodec/scpr3: add missing check for decode_value3() return value
authorJames Almer <jamrial@gmail.com>
Fri, 26 Apr 2019 15:31:19 +0000 (12:31 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 27 Apr 2019 19:15:00 +0000 (16:15 -0300)
Fixes ticket #7866.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/scpr3.c

index f92ccfa..5cfad9f 100644 (file)
@@ -1038,6 +1038,9 @@ static int decompress_p3(AVCodecContext *avctx,
                          s->range_model3.freqs[1],
                          s->range_model3.cnts,
                          s->range_model3.dectab, &temp);
+    if (ret < 0)
+        return ret;
+
     min += temp << 8;
     ret |= decode_value3(s, 255, &s->range_model3.cntsum,
                          s->range_model3.freqs[0],