aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-h264.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-03-30 16:35:58 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-03-30 16:35:58 +0000
commit184a60e0d6a5ea0171caa061f6d250683e4815a6 (patch)
tree585ba6d42df2bf988d36673a2b290b60a69b3967 /epan/dissectors/packet-h264.c
parent61a8dfa849d930c3c002803f6734b0cff56e8851 (diff)
downloadwireshark-184a60e0d6a5ea0171caa061f6d250683e4815a6.tar.gz
wireshark-184a60e0d6a5ea0171caa061f6d250683e4815a6.tar.bz2
wireshark-184a60e0d6a5ea0171caa061f6d250683e4815a6.zip
Handle NAL-unit start code correctly.
svn path=/trunk/; revision=27894
Diffstat (limited to 'epan/dissectors/packet-h264.c')
-rw-r--r--epan/dissectors/packet-h264.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c
index 8217ae2ab3..b8e2abffec 100644
--- a/epan/dissectors/packet-h264.c
+++ b/epan/dissectors/packet-h264.c
@@ -1,6 +1,6 @@
/* packet-h264.c
* Routines for H.264 dissection
- * Copyright 2007, Anders Broman <anders.broman[at]ericsson.com>
+ * Copyright 2007 - 2009, Anders Broman <anders.broman[at]ericsson.com>
*
* $Id$
*
@@ -1674,11 +1674,16 @@ 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
+ * B.1.1 Byte stream NAL unit syntax
+ */
+ dword = tvb_get_bits32(tvb, offset<<3, 32, FALSE);
if(dword==1){
- /* Start code */
+ /* zero_byte + start_code_prefix_one_3bytes */
offset+=4;
+ }else if((dword >> 8)== 1){
+ /* start_code_prefix_one_3bytes */
+ offset+= 3;
}
/* Ref: 7.3.1 NAL unit syntax */
nal_unit_type = tvb_get_guint8(tvb,offset) & 0x1f;