[Bug 706369] New: 2 * bad switch statements

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Aug 20 02:12:38 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=706369
  GStreamer | gst-plugins-bad | 0.10.23

           Summary: 2 * bad switch statements
    Classification: Platform
           Product: GStreamer
           Version: 0.10.23
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: dcb314 at hotmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


I just ran the static analysis checker "cppcheck" over
the source code of gstreamer-plugins-bad-free-0.10.23

It said

1.

[gstvc1parser.c:923] -> [gstvc1parser.c:926]: (warning) Variable 'ptype' is
reas
signed a value before the old one has been used. 'break;' missing?

      switch (pic->fptype) {
        case 0x00:
        case 0x02:
          framehdr->ptype = GST_VC1_PICTURE_TYPE_I;
        case 0x01:
        case 0x03:
          framehdr->ptype = GST_VC1_PICTURE_TYPE_P;
        case 0x04:
        case 0x06:
          framehdr->ptype = GST_VC1_PICTURE_TYPE_B;
        case 0x05:
        case 0x07:
          framehdr->ptype = GST_VC1_PICTURE_TYPE_BI;
      }

Suggest add break statements after each assignment.
Same problem a few lines lines further down.

2.

[gstmpegvideoparse.c:644] -> [gstmpegvideoparse.c:646]: (warning) Variable
'leve
l' is reassigned a value before the old one has been used. 'break;' missing?

      switch (level_c) {
        case 2:
          level = levels[0];
        case 5:
          level = levels[2];
          profile = "4:2:2";
          break;
        case 10:
          level = levels[0];
        case 11:
          level = levels[1];
        case 13:
          level = levels[2];
        case 14:
          level = levels[3];
          profile = "multiview";
          break;
        default:
          break;
      }

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list