tvb_length_remaining() can return -1, so be sure to deal with it if it does.

svn path=/trunk/; revision=43708
This commit is contained in:
Chris Maynard 2012-07-13 22:20:09 +00:00
parent 7320ebcfd9
commit 33b0d13dec
1 changed files with 2 additions and 2 deletions

View File

@ -593,8 +593,8 @@ dissect_mp4ves_VisualObject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
bit_offset+=24;
proto_tree_add_bits_item(tree, hf_mp4ves_start_code, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
bit_offset+= 8;
if(tvb_length_remaining(tvb,(bit_offset>>3))==0){
item = proto_tree_add_text(tree, tvb, 0, -1, "Config string to short");
if(tvb_length_remaining(tvb,(bit_offset>>3))<=0){
item = proto_tree_add_text(tree, tvb, 0, -1, "Config string too short");
PROTO_ITEM_SET_GENERATED(item);
return -1;
}