소스 검색

amigados: Skip partial sectors, as they cause an exception during decode

Keir Fraser 4 년 전
부모
커밋
b5fe05c761
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      scripts/greaseweazle/codec/amiga/amigados.py

+ 4 - 0
scripts/greaseweazle/codec/amiga/amigados.py

@@ -120,7 +120,11 @@ def decode_track(cyl, head, flux):
     
     sectors = bits.search(sync)
     for offs in bits.itersearch(sync):
+
         sec = bits[offs:offs+544*16].tobytes()
+        if len(sec) != 1088:
+            continue
+
         header = decode(sec[4:12])
         format, track, sec_id, togo = tuple(header)
         if format != 0xff or track != tracknr \