Merge branch 'qtfaststart-fix' into 'develop'

Fix MediaProxy crashing on some videos

See merge request pleroma/pleroma!4024
This commit is contained in:
feld 2024-01-13 04:35:32 +00:00
commit 9cc46c5538
2 changed files with 14 additions and 8 deletions

View file

@ -0,0 +1 @@
MediaProxy Preview failures prevented when encountering certain video files

View file

@ -40,6 +40,7 @@ defmodule Pleroma.Helpers.QtFastStart do
got_mdat,
acc
) do
try do
full_size = (size - 8) * 8
<<data::bits-size(full_size), rest::bits>> = rest
@ -50,6 +51,10 @@ defmodule Pleroma.Helpers.QtFastStart do
]
fix(rest, pos + size, got_moov || fourcc == "moov", got_mdat || fourcc == "mdat", acc)
rescue
_ ->
:abort
end
end
defp fix(<<>>, _pos, _, _, acc) do