diff --git a/libavformat/utils.c b/libavformat/utils.c
index 425db9a28a0cddd69ba2bd884590758139baa095..910aaca4e67fdab4303a20893c5be2f9d58e46bf 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1811,13 +1811,12 @@ int av_find_stream_info(AVFormatContext *ic)
                 ret = count;
                 break;
             }
-        } else {
+        }
             /* we did not get all the codec info, but we read too much data */
             if (read_size >= MAX_READ_SIZE) {
                 ret = count;
                 break;
             }
-        }
 
         /* NOTE: a new stream can be added there if no header in file
            (AVFMTCTX_NOHEADER) */