Browse Source

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

Keir Fraser 4 năm trước cách đây
mục cha
commit
b5fe05c761
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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 \