#15546: Fix {GzipFile,LZMAFile}.read1()'s handling of pathological input data.
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 8b89426..5bcfe61 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -385,7 +385,10 @@
             return b''
 
         try:
-            self._read()
+            # For certain input data, a single call to _read() may not return
+            # any data. In this case, retry until we get some data or reach EOF.
+            while self.extrasize <= 0:
+                self._read()
         except EOFError:
             pass
         if size < 0 or size > self.extrasize: