diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 90d16b1723b4506923c786d6159f9e2b78dcbfb7..4612c78ee9d8ae30913630f88601457350f564b0 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1114,6 +1114,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
                 if (s->geotags[i].count == 0
                     || s->geotags[i].offset + s->geotags[i].count > count) {
                     av_log(s->avctx, AV_LOG_WARNING, "Invalid GeoTIFF key %d\n", s->geotags[i].key);
+                } else if (s->geotags[i].val) {
+                    av_log(s->avctx, AV_LOG_WARNING, "Duplicate GeoTIFF key %d\n", s->geotags[i].key);
                 } else {
                     char *ap = doubles2str(&dp[s->geotags[i].offset], s->geotags[i].count, ", ");
                     if (!ap) {