diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-01-26 20:08:12 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-01-26 20:08:12 +0000 |
commit | e1eed9310150f74502dda8d41d1f2ca48251e145 (patch) | |
tree | 342ef8e5a2a530cdf93d0f5f967914f48b6be349 /epan | |
parent | 356c960719b832ccd87301c41cf0df0fd04cad54 (diff) |
Start code is 24 bits, use bit_offset to read it.
svn path=/trunk/; revision=27302
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-h264.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c index 8941f70ff2..e3e30e761a 100644 --- a/epan/dissectors/packet-h264.c +++ b/epan/dissectors/packet-h264.c @@ -1486,12 +1486,23 @@ dissect_h264_nal_unit(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) h264_nal_tree = proto_item_add_subtree(item, ett_h264_nal_unit); startover: - /* In decoder configuration start code may be pressent */ - dword = tvb_get_bits32(tvb,0,32,FALSE); + /* In decoder configuration start code may be pressent. + * while( next_bits( 24 ) != 0x000001 && + * next_bits( 32 ) != 0x00000001 ) + * leading_zero_8bits / * equal to 0x00 * / f(8) + * if( next_bits( 24 ) != 0x000001 ) + * zero_byte / * equal to 0x00 * / f(8) + * start_code_prefix_one_3bytes / * equal to 0x000001 * / f(24) + */ + dword = tvb_get_bits32(tvb,offset<<3,32,FALSE); if(dword==1){ - /* Start code */ + /* Start code + leading_zero_8bits */ offset+=4; + }else if(dword>>8==1){ + /* start code */ + offset+=3; } + /* Ref: 7.3.1 NAL unit syntax */ nal_unit_type = tvb_get_guint8(tvb,offset) & 0x1f; |