aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-h265.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-07Fix some more spelling errorsMartin Mathieson1-1/+1
2024-01-27Set BASE_NONE for FT_BOOLEAN items with zero maskMartin Mathieson1-18/+18
2023-11-20Remove init of proto variablesStig Bjørlykke1-336/+336
Remove init of proto, header field, expert info and subtree variables. This will reduces the binary size by approximate 1266320 bytes due to using .bss to zero-initialize the fields. The conversion is done using the tools/convert-proto-init.py script.
2023-11-15h265: Remove unused comments in hf variablesStig Bjørlykke1-157/+157
Remove comments behind some hf entries to prepare for the bigger change removing the initialize to -1.
2023-11-07epan: Prepare dissectors for initialize static values to 0Stig Bjørlykke1-1/+1
Change checks for valid hf values to include 0 as not valid. This will prepare the dissectors for a change to initialize proto values to 0 instead of -1.
2023-06-15Set more full mask fields to 0x0Martin Mathieson1-2/+2
2023-04-22H.265: The NAL header is 2 bytesJohn Thacker1-2/+2
This was copied from H.264, but here the header is 2 bytes so mark both bytes in the subtree text node
2023-04-22H.265: Add bytestream syntax dissector, use in MPEG-PESJohn Thacker1-0/+58
Add a dissector for H.265 with bytestream syntax, and use it in MPEG-PES when the PMT indicates H.265
2023-04-19H265: Implement access unit delimiterJohn Thacker1-1/+25
2022-11-23H264, H265: Fix overflow value of se(v)John Thacker1-3/+3
For signed exponential Golomb, fix a typo when testing if value was even or odd that resulted in a no-op. This was mapping all overflows to G_MININT32 instead of half of them to G_MAXINT32.
2022-10-24Add dot in Protocol column for H.xxx dissectorsStig Bjørlykke1-1/+1
Closes #18524
2022-10-16H265: Support RPS prediction in h265 SPSBin Peng1-11/+20
According to Rec. ITU-T H.265 7.3.7 and 7.4.8, when there are multiple RPS in SPS, RPS can be predicted from previous ones. But NumDletaPocs used to be a local variable for each RPS, prediction will always fail. In this change, NumDletaPocs is moved from dissect_h265_st_ref_pic_set to dissect_h265_seq_parameter_set_rbsp, to allow access to previous RPS data. This change also move each RPS into a subtree. Fix #18481
2022-07-31prefs: Convert most RTP dissectors to use "auto" PT preferencesJohn Thacker1-27/+4
Similar to commit 2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c, replace the RTP payload type preferences with automatic dissectors. This reduces the number of preference module callbacks.
2021-12-19Replace g_snprintf() with snprintf() (dissectors)João Valverde1-2/+2
Use macros from inttypes.h with format strings.
2021-09-28Fix some spelling errors.Martin Mathieson1-1/+1
2021-09-25H265: Handle too large Exponential-Golomb coded valuesJohn Thacker1-34/+101
We only allow exp-Golomb coded values to be as large as 32 bit integers. When packets encode too large a value (invalid content), clamp the value and report it as malformed with an expert info, reporting the number of bits consumed (which will probably lead to a BoundsError later in the packet.) The case with 32 leading zeroes is a special case because for both unsigned and signed interpretation there is one non overflowing value. This is better than using DISSECTOR_ASSERT for invalid packet content. Avoid left shifting a 32 bit integer by 32, which is undefined. Use DISSECTOR_ASSERT_FIELD_TYPE at the beginning of the function rather than using DISSECTOR_ASSERT in the middle, since it's more descriptive in its error message and clearer code to do it at the start. Same issue as #17612, commit a7dfe534883ee1f9d9cc84195b64b9a6f1ca9d0d.
2021-07-29Change some `wmem_packet_scope()` to `pinfo->pool`David Perry1-93/+93
As requested [here][1], help with replacing calls to `wmem_packet_scope()` with references to `pinfo->pool`. My principles were: * Plugins chosen semi-randomly. * When a calling function already has a `pinfo` argument, just use that. * Remove `_U_` from its signature if it was there. * Don't go more than 2 or 3 levels deep of changing signatures. * If a function is clearly allocing memory to return, change the function signature to take a `wmem_allocator_t *`. Otherwise, either that or take a `packet_info *` as seems to make sense. * No mention of `wmem_packet_scope()` should remain in the files I've touched. * I didn't always succeed at this, but I made a dent. [1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
2021-04-30Cast away the return value of g_strlcpy() and g_strlcat().Guy Harris1-19/+19
Most of the time, the return value tells us nothing useful, as we've already decided that we're perfectly willing to live with string truncation. Hopefully this keeps Coverity from whining that those routines could return an error code (NARRATOR: They don't) and thus that we're ignoring the possibility of failure (as indicated, we've already decided that we can live with string truncation, so truncation is *NOT* a failure).
2020-06-12RTP: Make Decode As handling consistent across subdissectorsJohn Thacker1-19/+7
RTP has two dissector tables, one directly associated with payload types, and one which is associated with strings that appear in SDP commands. This makes all dissectors that are registered as a dynamic payload type that can be configured by SDP appear as a Decode As option for the RTP PT table. Some protocols were registered in the table for configuration by SDP but had no way to register with the rtp.pt table. These include EVRC, H.223, and v150fw. Other protocols had a long standing preference to set a dynamic payload type, but they still did not appear in the Decode As menu unless that preference was changed from the default, largely because of the way that the preference was not actually registered with the rtp.pt table unless it had a value in the dynamic payload type range. These include EVS, H.263P, H.264, H.265, ISMACryp, IuUP, LAPD, MP4V-ES, RTP-MIDI, and VP8. RFC 3551 says that not just the dynamic payload types, but also the unassigned and even the statically assigned payload types MAY be dynamically reassigned as necessary, so this patch also allows these preferences to be set for payload types less than 96. The only payload type not allowed is 0 (which RFCs 3551 and 7007 say must be μ-law PCM), which is handy anyone for backwards compatibility with preferences that used to be uints (where 0 meant disabled.) All protcols which formerly used a uint preference are all converted to a range preference, and the text is changed to be similar for each. This works in a backwards compatible fashion, and any defaults are maintained. The patch also adds some of the dissector variants as PINOs so that they will show up with distinct names in the Decode As menus, and changes some of the protocol short names so that the entry in Decode As is clearer and matches what is used for other similar protocols. Change-Id: I68627b5c3e495d9fc813d88208f3b62e47e0c4de Reviewed-on: https://code.wireshark.org/review/37396 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-15H265: properly index 2D array (CID 1450950)Jaap Keuter1-6/+6
In the expression it seems to simply have been missed this is a 2D array. Adding the 2nd index, as elsewhere in this function. Change-Id: I21ce5a6fa70408f84cb61bbd09e7d3aeff9c1d85 Reviewed-on: https://code.wireshark.org/review/35441 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-10H265: Fix -Wpointer-sign warnings.Anders Broman1-12/+15
Change-Id: I7398216fcd03c619fe51182b5335ea47dd3fa110 Reviewed-on: https://code.wireshark.org/review/33888 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-04H.265: Small parsing fixesKave, Asaf1-6/+12
- h265_vps_reserved_0xffff_16bits parsing - general_profile_compatibility_flag matrix parsing. Change-Id: I1be4e4520571801a350913a820e4bc306c6f3158 Reviewed-on: https://code.wireshark.org/review/32299 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot
2019-02-25H265: Check range of H265_MAX_NUM_SHORT_TERM_REF_PIC_SETSAnders Broman1-2/+12
Check that value read from tvb is within protocol specified value. Bug: 15531 Change-Id: Icbfebef380aeb00f0d47a377a3bf3764f9cb1de0 Reviewed-on: https://code.wireshark.org/review/32189 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-20h265: fix no newline at end of file [-Wnewline-eof]Alexis La Goutte1-1/+1
Change-Id: I05ecc82f939e140fd6b4304b19bc0d6a301b0be9 Reviewed-on: https://code.wireshark.org/review/29190 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-14H.265: Fix incompatible use of proto_tree_add_bits_ret_val with field ↵Asaf Kave1-3/+1
'h265.reserved_zero_2bits' Change-Id: Ic4c9c8fd7676e9eada3ace59f5eb81b6fa339adc Reviewed-on: https://code.wireshark.org/review/29141 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-07-18H.265: Parsing media format specific parameter from SDP.Asaf Kave1-1/+62
Change-Id: I2607068671f370517b1f0a2f65f47a221b630d91 Reviewed-on: https://code.wireshark.org/review/28725 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-07-08H.265: implement Level bit rates, few general fixes.Asaf Kave1-18/+33
Fix wrong proto_tree_add_bits_item length, types for exp_golomb, sps_extension_4bits instead sps_scc_extension_flag. Remove useless bit_offset assignment which, triggered a Clang warning. Change-Id: Ibd6e5e9144df1feadbabbfe8498d33e4882f947f Reviewed-on: https://code.wireshark.org/review/28609 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-07-03Fix various compile warnings.Guy Harris1-5/+8
Use h265_profile_idc_values as the value_string for h265.general_profile_idc. Get rid of a duplicate value - 2 is used for both "Main 10" and "Main 10 Still" profiles, a *separate* part of the packet indicates whether it's the still picture version or not. "#if 0" out h265_level_bitrate_values - it's not clear where it should be used. Initialize two-dimensional arrays with { { 0 } }, i.e. an array of arrays, with the first element of the first array explicitly initialized to zero, and all the other elements of all the other arrays implicitly initialized to zero. Change-Id: Ia2ddc28528dcc49fa7a69685b7e5d08d2cd6b4e7 Reviewed-on: https://code.wireshark.org/review/28574 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-03Add first time H.265 based on the H.264 dissector.Asaf Kave1-0/+4560
Change-Id: I5b101d6713157a53d1d330e1bd2c70f7b7a247e1 Reviewed-on: https://code.wireshark.org/review/28426 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>