[FFmpeg-cvslog] avcodec/scpr: avoid using uninitialized value

Paul B Mahol git at videolan.org
Sun Apr 28 12:10:50 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Apr 28 11:06:36 2019 +0200| [ea80af659c609dca45eae7ec0fb1b4bfbbc620af] | committer: Paul B Mahol

avcodec/scpr: avoid using uninitialized value

Fixes #7872.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea80af659c609dca45eae7ec0fb1b4bfbbc620af
---

 libavcodec/scpr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index e5d7d13cf0..ce614ffacf 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -382,8 +382,11 @@ static int decompress_p(AVCodecContext *avctx,
 
     ret  = decode_value(s, s->range_model, 256, 1, &min);
     ret |= decode_value(s, s->range_model, 256, 1, &temp);
+    if (ret < 0)
+        return ret;
+
     min += temp << 8;
-    ret |= decode_value(s, s->range_model, 256, 1, &max);
+    ret  = decode_value(s, s->range_model, 256, 1, &max);
     ret |= decode_value(s, s->range_model, 256, 1, &temp);
     if (ret < 0)
         return ret;



More information about the ffmpeg-cvslog mailing list