summaryrefslogtreecommitdiffstats
path: root/macosx/PictureController.m
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-03-18 18:57:25 +0000
committerRodeo <[email protected]>2013-03-18 18:57:25 +0000
commit43e517866e21c7ac61b4981c16307dd141fc152d (patch)
tree52d7933728dafb1fdc0d45ed38c55251b10bbaeb /macosx/PictureController.m
parent30ddd53e26b3e2aa5930c6cf985f938e36985aed (diff)
MacGui: fix crash in PictureController.
For some reason, it only crashed in debug builds, but de-referencing fTitle before it's been set (e.g. indirectly from awakeFromNib) is obviously wrong. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5341 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/PictureController.m')
-rw-r--r--macosx/PictureController.m31
1 files changed, 18 insertions, 13 deletions
diff --git a/macosx/PictureController.m b/macosx/PictureController.m
index b15cd9b8c..d76762558 100644
--- a/macosx/PictureController.m
+++ b/macosx/PictureController.m
@@ -1041,12 +1041,11 @@
[fCropRightStepper setIntValue: job->crop[3]];
[fCropRightField setIntValue: job->crop[3]];
- //[fPreviewController SetTitle:fTitle];
-
- /* Sanity Check Here for < 16 px preview to avoid
- crashing hb_get_preview. In fact, just for kicks
- lets getting previews at a min limit of 32, since
- no human can see any meaningful detail below that */
+ /*
+ * Sanity-check here for previews < 16 pixels to avoid crashing
+ * hb_get_preview(). In fact, let's get previews at least 64 pixels in both
+ * dimensions; no human can see any meaningful detail below that.
+ */
if (job->width >= 64 && job->height >= 64)
{
[self reloadStillPreview];
@@ -1073,11 +1072,13 @@
}
- (void)reloadStillPreview
-{
- hb_job_t * job = fTitle->job;
-
- [fPreviewController SetTitle:fTitle];
-
+{
+ /* XXX: make sure we actually have a title before de-referencing it */
+ if (fTitle != NULL)
+ {
+ hb_job_t *job = fTitle->job;
+ [fPreviewController SetTitle:fTitle];
+ }
}
@@ -1229,6 +1230,12 @@ are maintained across different sources */
- (void) decombDeinterlacePreviewImage
{
+ /* XXX: make sure we actually have a title before de-referencing it */
+ if (fTitle == NULL)
+ {
+ return;
+ }
+
if ([fDecombDeinterlaceSlider floatValue] < 0.50)
{
/* Since Libhb only shows a deinterlaced preview image via deinterlace .. for decomb we
@@ -1259,8 +1266,6 @@ are maintained across different sources */
fTitle->job->deinterlace = [fDeinterlacePopUp indexOfSelectedItem];
[self reloadStillPreview];
}
-
-
}
#pragma mark -