Wireshark-bugs: [Wireshark-bugs] [Bug 3067] New: RTP dynamic payload clock rates incorrectly det
Date: Mon, 17 Nov 2008 09:05:41 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3067

           Summary: RTP dynamic payload clock rates incorrectly determined
           Product: Wireshark
           Version: 1.0.4
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: michael.lum@xxxxxxxxxxxxxxxxx


Build Information:
Version 1.0.2-StarSolutions-1

Copyright 1998-2008 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.12.8, with GLib 2.14.6, with WinPcap (version unknown),
with libz 1.2.3, without POSIX capabilities, with libpcre 7.0, with SMI 0.4.8,
with ADNS, with Lua 5.1, with GnuTLS 2.3.8, with Gcrypt 1.4.1, with MIT
Kerberos, with PortAudio V19-devel, with AirPcap.

Running on Windows XP Service Pack 3, build 2600, with WinPcap version 4.0.2
(packet.dll version 4.0.0.1040), based on libpcap version 0.9.5, without
AirPcap.

Built using Microsoft Visual C++ 6.0

Wireshark is Open Source Software released under the GNU General Public
License.

Check the man page and http://www.wireshark.org for more information.
--
(Source is from 1.0.4)

I was looking through tap-rtp-common.c because I wanted to add some 
CODECs when I noticed what I think is a bug.

In this function:

static guint32
get_dyn_pt_clock_rate(gchar *payload_type_str) {
    size_t i;

    for (i = 0; i < NUM_DYN_CLOCK_VALUES; i++) {
        if
(g_ascii_strncasecmp(mimetype_and_clock_map[i].pt_mime_name_str,payload_type_str,(strlen(mimetype_and_clock_map[i].pt_mime_name_str)))
== 0)
            return mimetype_and_clock_map[i].value;
    }

    return 1;
}

Here's the first 2 entries in the array:

static const mimetype_and_clock mimetype_and_clock_map[] = {
        {"AMR",         8000},                  /* [RFC3267] */
        {"AMR-WB",      16000},                 /* [RFC3267] */

So if 'payload_type_str' is equal to 'AMR-WB' I believe the first 
match will be 'AMR' and the returned clock rate of 8000 will be 
incorrect.

Wouldn't my example be the equivalent to

        strncasecmp("AMR", "AMR-WB", 3)

?


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