[FFmpeg-trac] #6715(undetermined:new): Uninitialized variable in ff_h264_hl_decode_mb

FFmpeg trac at avcodec.org
Tue Oct 3 04:29:34 EEST 2017

#6715: Uninitialized variable in ff_h264_hl_decode_mb
             Reporter:  jwatte       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 I am building a program that decodes H264 captured video, and then runs
 computer vision analysis on it.

 When I ran my program through valgrind, it complained that I was depending
 on uninitialized data.

 Turning on thorough source tracking, it turns out that the uninitialized
 data was created inside libavcodec:

 ==11510== Conditional jump or move depends on uninitialised value(s)
 ==11510==    at 0x76AF5B8: sqrt (w_sqrt.c:27)
 ==11510==    by 0x18FA43: compute_labels_cv(int, void const*, unsigned
 char const*, float*) (main.cpp:574)
 ==11510==    by 0x190B4D: database_frame(int, int, int, void const*, int,
 void const*, int, void const*, int, float, float) (main.cpp:786)
 ==11510==    by 0x192629: generate_dataset(char const*) (main.cpp:1074)
 ==11510==    by 0x193D7E: main (main.cpp:1421)
 ==11510==  Uninitialised value was created by a stack allocation
 ==11510==    at 0x5C6920: ff_h264_hl_decode_mb (h264_mb.c:798)

 This is using version 12.1 of libav.

 The line is:

     int is_complex    = CONFIG_SMALL || sl->is_complex ||
 IS_INTRA_PCM(mb_type) || sl->qscale == 0;

 Presumably, sl->is_complex or sl->qscale aren't initialized at this point?

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

More information about the FFmpeg-trac mailing list