소스 검색

LibGfx/GIF: Shorten the lifetime of lzw_encoded_bytes_expected

Lucas CHOLLET 1 년 전
부모
커밋
7aa76e6c9f
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      Userland/Libraries/LibGfx/ImageFormats/GIFLoader.cpp

+ 3 - 3
Userland/Libraries/LibGfx/ImageFormats/GIFLoader.cpp

@@ -350,10 +350,10 @@ static ErrorOr<void> load_gif_frame_descriptors(GIFLoadingContext& context)
 
             image->lzw_min_code_size = TRY(context.stream.read_value<u8>());
 
-            u8 lzw_encoded_bytes_expected = 0;
-
             for (;;) {
-                lzw_encoded_bytes_expected = TRY(context.stream.read_value<u8>());
+                auto const lzw_encoded_bytes_expected = TRY(context.stream.read_value<u8>());
+
+                // Block terminator
                 if (lzw_encoded_bytes_expected == 0)
                     break;