bpm: Fix potential null-pointer dereference
`update_metrics()` in `bpm.c` is checking for null pointer arguments, and there was a very minor chance of dereferencing a null-pointer in the logged message. Correct the logic to prevent this from happening.
This commit is contained in:
parent
80ea1b14fb
commit
64cb68af56
1 changed files with 6 additions and 1 deletions
|
|
@ -16,7 +16,12 @@ static void render_metrics_time(struct metrics_time *m_time)
|
|||
static bool update_metrics(obs_output_t *output, const struct encoder_packet *pkt,
|
||||
const struct encoder_packet_time *ept, struct metrics_data *m_track)
|
||||
{
|
||||
if (!output || !pkt || !ept || !m_track) {
|
||||
if (!pkt) {
|
||||
blog(LOG_DEBUG, "%s: Null encoder_packet pointer", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!output || !ept || !m_track) {
|
||||
blog(LOG_DEBUG, "%s: Null arguments for track %lu", __FUNCTION__, pkt->track_idx);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue