Don't crash if exif_content_ref/unref is passed NULL.
authorDan Fandrich <dan@coneharvesters.com>
Sat, 27 Apr 2019 17:30:01 +0000 (19:30 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 27 Apr 2019 17:30:45 +0000 (19:30 +0200)
The rest of the API functions already handle NULL values.

libexif/exif-content.c

index 6d6c589..5f39c1b 100644 (file)
@@ -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);