diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2015-09-10 13:41:16 -0400 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2015-09-14 21:27:19 +0000 |
commit | a1491c7777f2e6d3737fa0049c2e46a0a244b52a (patch) | |
tree | e9a34ff73dfaf6407a30b275ab5b4ee2da89f2ab | |
parent | 50893c96155a4f77813357983bea1c5941fd61c1 (diff) | |
download | wireshark-a1491c7777f2e6d3737fa0049c2e46a0a244b52a.tar.gz |
MPEG-PES: tell the user (in COL_INFO) when the stream or frame type is unknown.
Inspired by: https://www.wireshark.org/lists/wireshark-users/201508/msg00023.html
Change-Id: Ib632b79aef5cbb4c83965a276ec955be43493455
Reviewed-on: https://code.wireshark.org/review/10472
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
-rw-r--r-- | asn1/mpeg-pes/packet-mpeg-pes-template.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-mpeg-pes.c | 13 |
2 files changed, 6 insertions, 16 deletions
diff --git a/asn1/mpeg-pes/packet-mpeg-pes-template.c b/asn1/mpeg-pes/packet-mpeg-pes-template.c index 01e4f43ffc..98147d3bcf 100644 --- a/asn1/mpeg-pes/packet-mpeg-pes-template.c +++ b/asn1/mpeg-pes/packet-mpeg-pes-template.c @@ -374,7 +374,6 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data int stream; asn1_ctx_t asn1_ctx; gint offset = 0; - const char *s; if (!tvb_bytes_exist(tvb, 0, 3)) return FALSE; /* not enough bytes for a PES prefix */ @@ -386,9 +385,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data col_clear(pinfo->cinfo, COL_INFO); stream = tvb_get_guint8(tvb, 3); - s = try_val_to_str(stream, mpeg_pes_T_stream_vals); - if (s != NULL) - col_set_str(pinfo->cinfo, COL_INFO, s); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(stream, mpeg_pes_T_stream_vals, "Unknown stream: %d")); #if 0 if (tree == NULL) @@ -402,9 +399,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data int frame_type; frame_type = tvb_get_guint8(tvb, 5) >> 3 & 0x07; - s = try_val_to_str(frame_type, mpeg_pes_T_frame_type_vals); - if (s != NULL) - col_set_str(pinfo->cinfo, COL_INFO, s); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(frame_type, mpeg_pes_T_frame_type_vals, "Unknown frame type: %d")); offset = dissect_mpeg_pes_Picture(tvb, offset, &asn1_ctx, tree, hf_mpeg_video_picture); diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c index 63f48bffc9..0ef1805ed2 100644 --- a/epan/dissectors/packet-mpeg-pes.c +++ b/epan/dissectors/packet-mpeg-pes.c @@ -815,7 +815,6 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data int stream; asn1_ctx_t asn1_ctx; gint offset = 0; - const char *s; if (!tvb_bytes_exist(tvb, 0, 3)) return FALSE; /* not enough bytes for a PES prefix */ @@ -827,9 +826,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data col_clear(pinfo->cinfo, COL_INFO); stream = tvb_get_guint8(tvb, 3); - s = try_val_to_str(stream, mpeg_pes_T_stream_vals); - if (s != NULL) - col_set_str(pinfo->cinfo, COL_INFO, s); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(stream, mpeg_pes_T_stream_vals, "Unknown stream: %d")); #if 0 if (tree == NULL) @@ -843,9 +840,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data int frame_type; frame_type = tvb_get_guint8(tvb, 5) >> 3 & 0x07; - s = try_val_to_str(frame_type, mpeg_pes_T_frame_type_vals); - if (s != NULL) - col_set_str(pinfo->cinfo, COL_INFO, s); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(frame_type, mpeg_pes_T_frame_type_vals, "Unknown frame type: %d")); offset = dissect_mpeg_pes_Picture(tvb, offset, &asn1_ctx, tree, hf_mpeg_video_picture); @@ -1189,7 +1184,7 @@ proto_register_mpeg_pes(void) "BIT_STRING_SIZE_16", HFILL }}, /*--- End of included file: packet-mpeg-pes-hfarr.c ---*/ -#line 547 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c" +#line 542 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c" { &hf_mpeg_pes_pack_header, { "Pack header", "mpeg-pes.pack", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, @@ -1307,7 +1302,7 @@ proto_register_mpeg_pes(void) &ett_mpeg_pes_Picture, /*--- End of included file: packet-mpeg-pes-ettarr.c ---*/ -#line 654 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c" +#line 649 "../../asn1/mpeg-pes/packet-mpeg-pes-template.c" &ett_mpeg_pes_pack_header, &ett_mpeg_pes_header_data, &ett_mpeg_pes_trick_mode |