From 8701f10ea9532b92018f20bf2bd6eb8df45e188b Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sat, 27 Apr 2019 19:30:01 +0200 Subject: [PATCH] Don't crash if exif_content_ref/unref is passed NULL. The rest of the API functions already handle NULL values. --- libexif/exif-content.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libexif/exif-content.c b/libexif/exif-content.c index 6d6c589..5f39c1b 100644 --- a/libexif/exif-content.c +++ b/libexif/exif-content.c @@ -78,12 +78,18 @@ exif_content_new_mem (ExifMem *mem) void exif_content_ref (ExifContent *content) { + if (!content) + return; + content->priv->ref_count++; } void exif_content_unref (ExifContent *content) { + if (!content) + return; + content->priv->ref_count--; if (!content->priv->ref_count) exif_content_free (content); -- 2.7.4