Avoid infinite loop on corrupt stream recording (#96881)
* Avoid infinite loop on corrupt stream recording * Update testspull/96890/head
parent
f2bd122fde
commit
3e58e1987c
|
@ -151,7 +151,7 @@ def find_moov(mp4_io: BufferedIOBase) -> int:
|
|||
while 1:
|
||||
mp4_io.seek(index)
|
||||
box_header = mp4_io.read(8)
|
||||
if len(box_header) != 8:
|
||||
if len(box_header) != 8 or box_header[0:4] == b"\x00\x00\x00\x00":
|
||||
raise HomeAssistantError("moov atom not found")
|
||||
if box_header[4:8] == b"moov":
|
||||
return index
|
||||
|
|
|
@ -245,7 +245,7 @@ class FakePyAvBuffer:
|
|||
# Forward to appropriate FakeStream
|
||||
packet.stream.mux(packet)
|
||||
# Make new init/part data available to the worker
|
||||
self.memory_file.write(b"\x00\x00\x00\x00moov")
|
||||
self.memory_file.write(b"\x00\x00\x00\x08moov")
|
||||
|
||||
def close(self):
|
||||
"""Close the buffer."""
|
||||
|
|
Loading…
Reference in New Issue