aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-h264.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2008-11-10 20:20:11 +0000
committerAnders Broman <anders.broman@ericsson.com>2008-11-10 20:20:11 +0000
commitcacf4e9a14d595becb5ff9ffd76a2619a274b6f1 (patch)
tree3273bb2725ae3acbf2ffae7457d0724e5ef0368a /epan/dissectors/packet-h264.c
parent5e4d2e3e0b06c39c5547e9ef3579aaa3df3c66d5 (diff)
Bugfixes:
- Wrong item lengths. - rtsp traling bits gave"Malformed packet" if not present. - Frame_num removed as length needs info from previous packet. svn path=/trunk/; revision=26744
Diffstat (limited to 'epan/dissectors/packet-h264.c')
-rw-r--r--epan/dissectors/packet-h264.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c
index 74bbf05271..8dfdf05e55 100644
--- a/epan/dissectors/packet-h264.c
+++ b/epan/dissectors/packet-h264.c
@@ -647,17 +647,17 @@ more_rbsp_data(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, gint
static int
dissect_h264_rbsp_trailing_bits(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint bit_offset)
{
- gint remaining_bits;
+ gint remaining_bits=0;
proto_tree_add_bits_item(tree, hf_h264_rbsp_stop_bit, tvb, bit_offset, 1, FALSE);
bit_offset++;
- remaining_bits = 8 - (bit_offset&0x7);
-
- proto_tree_add_bits_item(tree, hf_h264_rbsp_trailing_bits, tvb, bit_offset, remaining_bits, FALSE);
+ if((bit_offset&0x7)!=0){
+ remaining_bits = 8 - (bit_offset&0x7);
+ proto_tree_add_bits_item(tree, hf_h264_rbsp_trailing_bits, tvb, bit_offset, remaining_bits, FALSE);
+ }
return bit_offset+remaining_bits;
-
}
/*
@@ -678,8 +678,12 @@ dissect_h264_slice_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U
dissect_h264_exp_golomb_code(tree, hf_h264_pic_parameter_set_id, tvb, &bit_offset, H264_UE_V);
/* frame_num 2 u(v) */
- /* XXXX Is frame_num allways 4 bits in the bit stream? */
- proto_tree_add_bits_item(tree, hf_h264_frame_num, tvb, bit_offset, 4, FALSE);
+ /*
+ * represented by log2_max_frame_num_minus4 + 4 bits in
+ * the bitstream
+ * proto_tree_add_bits_item(tree, hf_h264_frame_num, tvb, bit_offset, 4, FALSE);
+ */
+
return bit_offset;
}
@@ -743,19 +747,19 @@ dissect_h264_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo
bit_offset++;
}
/* initial_cpb_removal_delay_length_minus1 0 u(5) */
- proto_tree_add_bits_item(tree, hf_h264_initial_cpb_removal_delay_length_minus1, tvb, bit_offset, 1, FALSE);
+ proto_tree_add_bits_item(tree, hf_h264_initial_cpb_removal_delay_length_minus1, tvb, bit_offset, 5, FALSE);
bit_offset = bit_offset + 5;
/* cpb_removal_delay_length_minus1 0 u(5) */
- proto_tree_add_bits_item(tree, hf_h264_cpb_removal_delay_length_minus1, tvb, bit_offset, 1, FALSE);
+ proto_tree_add_bits_item(tree, hf_h264_cpb_removal_delay_length_minus1, tvb, bit_offset, 5, FALSE);
bit_offset = bit_offset + 5;
/* dpb_output_delay_length_minus1 0 u(5) */
- proto_tree_add_bits_item(tree, hf_h264_dpb_output_delay_length_minus11, tvb, bit_offset, 1, FALSE);
+ proto_tree_add_bits_item(tree, hf_h264_dpb_output_delay_length_minus11, tvb, bit_offset, 5, FALSE);
bit_offset = bit_offset + 5;
/* time_offset_length 0 u(5) */
- proto_tree_add_bits_item(tree, hf_h264_time_offset_length, tvb, bit_offset, 1, FALSE);
+ proto_tree_add_bits_item(tree, hf_h264_time_offset_length, tvb, bit_offset, 5, FALSE);
bit_offset = bit_offset + 5;
return bit_offset;