[FFmpeg-trac] #2310(undetermined:new): x264: x264_cqm_init access beyond array causes undefined behavior in gcc48

FFmpeg trac at avcodec.org
Wed Feb 27 20:35:55 CET 2013


#2310: x264: x264_cqm_init access beyond array causes undefined behavior in gcc48
-------------------------------------+-------------------------------------
             Reporter:  Safari       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 can't x264 bugs be submitted with trac..? anyways...

 i can get to 7, whereas quant4_mf quant4_bias0 quant4_mf dequant4_mf and
 unquant4_mf are defined as array [4], therefore undefined behavior happens
 with gcc-4.8-0.14.fc19 (infinite loop).

 How to reproduce:

 run x264 and it segfaults in x264_cqm_init.

 small test case which causes infinite loop

 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
 #include <stdlib.h>

 uint32_t (*quant4_mf[4])[16];

 int main(int argc, char *argv[])
 {
     int i;

     for(i = 0; i < 8; i++ )
     {
         fprintf(stderr, "i=%d\n", i);
         quant4_mf[i] = (void*)0;
     }
     return 0;
 }



 {{{
 % ffmpeg -i input ... output
 ffmpeg version
 built on ...
 }}}
 Patches should be submitted to the ffmpeg-devel mailing list and not this
 bug tracker.

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


More information about the FFmpeg-trac mailing list