summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-12 00:24:06 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-12 00:24:06 +0100
commit5ec4cafd9ed9966c0af6b3f33f78cc833950ee0c (patch)
treeda42d1474e8bcf5a60369f1273437a75200adde7 /src
parent937c2bc377cb8f15d41cbd8166b7b3fe61b580a6 (diff)
Fix potential crash.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_viewer.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 0caa296ef..fb7317dc6 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -49,6 +49,11 @@ public:
/** Handle a paint event */
void paint_event (wxPaintEvent& ev)
{
+ if (!_film) {
+ wxPaintDC dc (this);
+ return;
+ }
+
if (_frame_rebuild_needed) {
_image.reset (new wxImage (std_to_wx (_film->thumb_file (_index))));
@@ -74,7 +79,7 @@ public:
dc.DrawBitmap (*_bitmap, 0, 0, false);
}
- if (_film && _film->with_subtitles ()) {
+ if (_film->with_subtitles ()) {
for (list<SubtitleView>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
dc.DrawBitmap (*i->bitmap, i->cropped_position.x, i->cropped_position.y, true);
}