Fix comment typos
diff --git a/apps/avifgainmaputil/imageio.h b/apps/avifgainmaputil/imageio.h
index 7b567b8..308bd2a 100644
--- a/apps/avifgainmaputil/imageio.h
+++ b/apps/avifgainmaputil/imageio.h
@@ -22,7 +22,7 @@
                      bool ignore_profile, bool ignore_alpha,
                      bool ignore_gain_map, int jobs);
 
-// Reads an image in avif format given a pre-configured encoder.
+// Writes an image in avif format given a pre-configured encoder.
 avifResult WriteAvif(const avifImage* image, avifEncoder* encoder,
                      const std::string& output_filename);
 
diff --git a/include/avif/avif.h b/include/avif/avif.h
index 28b6e2d..44ca021 100644
--- a/include/avif/avif.h
+++ b/include/avif/avif.h
@@ -1453,7 +1453,7 @@
 // avifDecoderNextImage() or avifDecoderNthImage() was called, the gain map's planes can also be accessed
 // in the same way. If the gain map's height is different from the main image, then the number of
 // available gain map rows is at least:
-//   roundf((float)decoded_row_count / decoder->image->height * decoder->image->gainMap.image->height)
+//   roundf((float)decoded_row_count / decoder->image->height * decoder->image->gainMap->image->height)
 // When gain map scaling is needed, callers might choose to use a few less rows depending on how many rows
 // are needed by the scaling algorithm, to avoid the last row(s) changing when more data becomes available.
 // decoder->allowIncremental must be set to true before calling avifDecoderNextImage() or