diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2017-05-08 17:47:46 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-05-12 12:08:15 +0000 |
commit | 0eaeb99f063c2fcf13108ebb60888f7f2077e793 (patch) | |
tree | 772840899ab7d4ae83c74480149d4c94a18805ce /epan/dissectors/file-gif.c | |
parent | f022976359df621d1c940f79f40a42b1d0220504 (diff) |
gif: make data block an FT_UINT_BYTES entry
The length byte is now highlighted along with the actual data.
Change-Id: I93ce25ad2cd7c790cc23668d354e32c4f5e195c6
Reviewed-on: https://code.wireshark.org/review/21610
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/file-gif.c')
-rw-r--r-- | epan/dissectors/file-gif.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/epan/dissectors/file-gif.c b/epan/dissectors/file-gif.c index 68b87d8597..28eb0f9323 100644 --- a/epan/dissectors/file-gif.c +++ b/epan/dissectors/file-gif.c @@ -277,7 +277,7 @@ static header_field_info hfi_trailer GIF_HFI_INIT = { static header_field_info hfi_data_block GIF_HFI_INIT = { "Data block", IMG_GIF ".data_block", - FT_BYTES, BASE_NONE, NULL, 0x00, + FT_UINT_BYTES, BASE_NONE|BASE_ALLOW_ZERO, NULL, 0x00, NULL, HFILL }; @@ -451,6 +451,7 @@ dissect_gif(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) * - Before the GIF termination character */ while (tvb_reported_length_remaining(tvb, offset)) { + proto_item *db_ti; peek = tvb_get_guint8(tvb, offset); if (peek == 0x21) { /* GIF extension block */ guint32 item_len = 2; /* Fixed header consisting of: @@ -472,9 +473,9 @@ dissect_gif(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) do { /* Read length of data block */ len = tvb_get_guint8(tvb, offset); - proto_tree_add_bytes_format(subtree, hfi_data_block.id, tvb, - offset+1, len, NULL, - "Data block (length = %u)", len); + db_ti = proto_tree_add_item(subtree, &hfi_data_block, + tvb, offset, 1, ENC_NA); + proto_item_append_text(db_ti, " (length = %u)", len); offset += (1 + len); item_len += (1 + len); } while (len > 0); @@ -551,9 +552,9 @@ dissect_gif(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) do { /* Read length of data block */ len = tvb_get_guint8(tvb, offset); - proto_tree_add_bytes_format(subtree, hfi_data_block.id, tvb, - offset + 1, len, NULL, - "Data block (length = %u)", len); + db_ti = proto_tree_add_item(subtree, &hfi_data_block, + tvb, offset, 1, ENC_NA); + proto_item_append_text(db_ti, " (length = %u)", len); offset += 1 + len; item_len += (1 + len); } while (len > 0); |