Skip to content

Commit

Permalink
Fixed QT segmentation fault in QBitmap.fromData in GlyphEntry (#428)
Browse files Browse the repository at this point in the history
It's a weird fix but other attempts lead to video corruption see ticket for details.

Tests started failing in CI so the QT_QPA_PLATFORM environment variable trick was required to avoid that.
  • Loading branch information
obilodeau committed Dec 20, 2022
1 parent 85d7d1a commit 6f6f704
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/pyrdp-convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
if not HAS_GUI and args.format == "mp4":
sys.stderr.write("Error: MP4 conversion requires the full PyRDP installation.")
sys.exit(1)
elif HAS_GUI and args.format == "mp4":
# Initialize QT because QBitmap will segfault without it (#378, #428)
from PySide2.QtWidgets import QApplication
app = QApplication()

logging.basicConfig(level=logging.CRITICAL)
logging.getLogger("scapy").setLevel(logging.ERROR)
Expand Down
2 changes: 2 additions & 0 deletions test/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ else
PREPEND="coverage run --append bin/"
fi

export QT_QPA_PLATFORM=offscreen

echo ===================================================
echo pyrdp-player.py read a replay in headless mode test
${PREPEND}pyrdp-player.py --headless test/files/test_session.replay
Expand Down

0 comments on commit 6f6f704

Please sign in to comment.