Merge branch 'qtfaststart-fix' into 'develop'
Fix MediaProxy crashing on some videos See merge request pleroma/pleroma!4024
This commit is contained in:
commit
9cc46c5538
|
@ -0,0 +1 @@
|
||||||
|
MediaProxy Preview failures prevented when encountering certain video files
|
|
@ -40,16 +40,21 @@ defp fix(
|
||||||
got_mdat,
|
got_mdat,
|
||||||
acc
|
acc
|
||||||
) do
|
) do
|
||||||
full_size = (size - 8) * 8
|
try do
|
||||||
<<data::bits-size(full_size), rest::bits>> = rest
|
full_size = (size - 8) * 8
|
||||||
|
<<data::bits-size(full_size), rest::bits>> = rest
|
||||||
|
|
||||||
acc = [
|
acc = [
|
||||||
{fourcc, pos, pos + size, size,
|
{fourcc, pos, pos + size, size,
|
||||||
<<size::integer-big-size(32), fourcc::bits-size(32), data::bits>>}
|
<<size::integer-big-size(32), fourcc::bits-size(32), data::bits>>}
|
||||||
| acc
|
| acc
|
||||||
]
|
]
|
||||||
|
|
||||||
fix(rest, pos + size, got_moov || fourcc == "moov", got_mdat || fourcc == "mdat", acc)
|
fix(rest, pos + size, got_moov || fourcc == "moov", got_mdat || fourcc == "mdat", acc)
|
||||||
|
rescue
|
||||||
|
_ ->
|
||||||
|
:abort
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp fix(<<>>, _pos, _, _, acc) do
|
defp fix(<<>>, _pos, _, _, acc) do
|
||||||
|
|
Loading…
Reference in New Issue