[FFmpeg-trac] #7866(avcodec:new): libavcodec/scpr3.c:decompress_p3() use of uninitialized variable

FFmpeg trac at avcodec.org
Thu Apr 25 11:30:01 EEST 2019


#7866: libavcodec/scpr3.c:decompress_p3()  use of uninitialized variable
---------------------------------+---------------------------------------
             Reporter:  fisher   |                     Type:  defect
               Status:  new      |                 Priority:  normal
            Component:  avcodec  |                  Version:  unspecified
             Keywords:           |               Blocked By:
             Blocking:           |  Reproduced by developer:  0
Analyzed by developer:  0        |
---------------------------------+---------------------------------------
 in  static int decompress_p3(AVCodecContext *avctx,
                          uint32_t *dst, int linesize,
                          uint32_t *prev, int plinesize)
 function, in

 |int ret, temp, min, max, x, y, cx = 0, cx1 = 0;|

 |temp| is not uninitialized ,and in
  ret |= decode_value3(s, 255, &s->range_model3.cntsum,
                          s->range_model3.freqs[0],
                          s->range_model3.freqs[1],
                          s->range_model3.cnts,
                          s->range_model3.dectab, &temp);
 decode_value3() function may fail and return without assigning a value to
 |temp|,so |temp|  is still a uninitialized variable.

 and in   |min += temp << 8;| ,temp will be used.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7866>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list