aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/file-gif.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-29gif: expert info for unknown data block typeMartin Kaiser1-1/+20
Before this patch, the dissector would assume that any data block type that is unknown must be the trailer byte. Check explicitly if we have a trailer byte and bring up an expert info for unknown data block types. Change-Id: I4c3087eb403e2e668a22628062edd0240309a2bc Reviewed-on: https://code.wireshark.org/review/21790 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>
2017-05-13gif: simplify the dissection codeMartin Kaiser1-56/+57
Increment offset as we go through the file. Add a function to dissect a sequence of data blocks. Call this function for extension blocks and images. Change-Id: If156cb9cd4fe4ba6fdd3780c93087f2dd2ae8bf5 Reviewed-on: https://code.wireshark.org/review/21547 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>
2017-05-12gif: make data block an FT_UINT_BYTES entryMartin Kaiser1-7/+8
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>
2017-05-07gif: fix the version detectionMartin Kaiser1-2/+2
tvb_strneql() returns 0 if the two strings are equal. Thanks to Ahmad Fatoum for reporting this bug. Change-Id: Id6cde56623e18fe0a28f37b108dc1848cc58e1c3 Reviewed-on: https://code.wireshark.org/review/21554 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07gif: start cleaning up the dissection codeMartin Kaiser1-243/+233
Remove the global if(tree). We should not throw exceptions under if (tree). Buf we may get exceptions while parsing the gif file. Process the version string once as we go through the file. (Ok, we already had to look at it to figure out that we have a gif file.) Use tvb_reported_length_remaining() in the main loop. Change-Id: Ie00594eebffc715676ffd5df8cbf7d43034aa68d Reviewed-on: https://code.wireshark.org/review/21545 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07gif: refactor the detection of a gif fileMartin Kaiser1-9/+7
Generally, we should not throw an exception before we know that this is our file/packet. Use tvb_strneql() to get the version string. This function does not throw an exception if there are fewer bytes left than we requested. (I know that we check for reported len < 20. However, for captured length > 6 and reported length < 20, the current code does not work.) Change-Id: I5214c5c9dc9da616a94ae96269ec1c9e6f412e8e Reviewed-on: https://code.wireshark.org/review/21544 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07gif: remove pointless coments, unused debug macroMartin Kaiser1-17/+1
Change-Id: Id4ac23a7e5164e40ddc0ee22ddb62f7121b74ad9 Reviewed-on: https://code.wireshark.org/review/21543 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-05-07gif: (trivial) fix a typoMartin Kaiser1-1/+1
The trailer byte is 0x3b, not 0xb3. Change-Id: I9b2d21f369957fc0c4eb5ff376c4aa7fbdc28c9e Reviewed-on: https://code.wireshark.org/review/21542 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't include "file.h" if you don't need it.Guy Harris1-1/+2
It ends up dragging in libwireshark headers, which programs not linking with libwireshark shouldn't do. In particular, including <epan/address.h> causes some functions that refer to libwireshark functions to be defined if the compiler doesn't handle "static inline" the way GCC does, and you end up requiring libwireshark even though you shouldn't require it. Move plurality() to wsutil/str_util.h, so that non-libwireshark code can get it without include epan/packet.h. Fix includes as necessary. Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3 Reviewed-on: https://code.wireshark.org/review/11545 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17Remove all preferences related to enabling/disabling heuristic dissectors.Michael Mann1-2/+2
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector. Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled. Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22 Reviewed-on: https://code.wireshark.org/review/9610 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12Add "user presentable" and "unique string ids" to heuristic table entries.Michael Mann1-2/+2
This allows better presentation of heuristic dissectors to the end user. Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6 Reviewed-on: https://code.wireshark.org/review/9602 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-1/+0
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9 Reviewed-on: https://code.wireshark.org/review/5997 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-05Reformat hfi entries; Add editor modelines; Adjust whitespace.Bill Meier1-173/+186
Change-Id: Iead53f92cc847d04c32f4a307d45f9748c49a69c Reviewed-on: https://code.wireshark.org/review/4483 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-01GIF: add a missing hf registrationPascal Quantin1-0/+2
Change-Id: Ib90054ef8a87f40249f644e8c7065b755419a11c Reviewed-on: https://code.wireshark.org/review/4396 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-09-27Eliminate proto_tree_add_text from some dissectors.Michael Mann1-4/+10
Some other related cleanup. Change-Id: I45f54032aa8318858f4ee784945b6f2ed163b6ea Reviewed-on: https://code.wireshark.org/review/4328 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22convert to proto_tree_add_subtree[_format]Michael Mann1-4/+2
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0 Reviewed-on: https://code.wireshark.org/review/2508 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-18the gif version string is 7bit ASCIIMartin Kaiser1-1/+1
Change-Id: I1e827ad4d2cf64411c5a87f4710235dc4d6efc35 Reviewed-on: https://code.wireshark.org/review/250 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-01-29MIME: Rename image dissectors to file dissectors.Michal Labedzki1-0/+706
Change-Id: Ie160733ceeed23ff96ddccfbf0ca2e7694789ff8