[Ffmpeg-devel] Usage of un-initialized variable in function mpeg4_decode_block()

Rahul Kumar kr.rahul
Tue Mar 7 16:11:42 CET 2006


Hi everyone,

I have been trying to test the ffmpeg code against ISO bitstreams (&
the ISO decoder). I found failure for one of the MPEG4 Simple Profile
bitstreams due to the following code:

FILE NAME: h263.c

mpeg4_decode_block()
{
    if(intra)
    {
      if(s->qscale < s->intra_dc_threshold)
      {
        // initialize dc level & dc_pred_dir
      }
      else
      {
        //set i = -1 without initializing dc_pred_dir
      }
...
...
..//further down in the code
        if (s->ac_pred) {
            if (dc_pred_dir == 0)
                scan_table = s->intra_v_scantable.permutated; /* left */
            else
                scan_table = s->intra_h_scantable.permutated; /* top */
        } else {
            scan_table = s->intra_scantable.permutated;
        }


Note that if ((s->qscale < s->intra_dc_threshold) && (s->ac_pred==1)),
then the above code will use dc_pred_dir without initializing it. This
can be sorted by putting a small code to initialize the dc_pred_dir in
the first else condition.

Regards,
Rahul Kumar





More information about the ffmpeg-devel mailing list