]> granicus.if.org Git - handbrake/commitdiff
fix some crashes in the macui
authorjstebbins <jstebbins.hb@gmail.com>
Wed, 12 Dec 2012 20:21:14 +0000 (20:21 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Wed, 12 Dec 2012 20:21:14 +0000 (20:21 +0000)
I missed setting some pointers to NULL after free and missed place
where the ui was setting job->file directly instead of using hb_job_set_file().
Also, a NULL chapter name caused a crash.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5097 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/common.c
libhb/stream.c
macosx/HBPreviewController.m

index 60c2b4ed7e61919d552faa5ad9f8ced45b9eaa30..34c97da5414885330441695bbc90feb6f7408ec9 100644 (file)
@@ -1738,7 +1738,9 @@ static void job_clean( hb_job_t * job )
         hb_attachment_t *attachment;
 
         free(job->file);
+        job->file = NULL;
         free(job->advanced_opts);
+        job->advanced_opts = NULL;
 
         // clean up chapter list
         while( ( chapter = hb_list_item( job->list_chapter, 0 ) ) )
index 5d4f36516a4b58fd14c04b79f5e5ce9988ae980b..02a49e20c204e0b4154ecb66b287ccd407aaaeaf 100644 (file)
@@ -1076,6 +1076,7 @@ hb_title_t * hb_stream_title_scan(hb_stream_t *stream, hb_title_t * title)
     // One Chapter
     hb_chapter_t * chapter;
     chapter = calloc( sizeof( hb_chapter_t ), 1 );
+    hb_chapter_set_title( chapter, "Chapter 1" );
     chapter->index = 1;
     chapter->duration = title->duration;
     chapter->hours = title->hours;
index 03b3416154f85d6286d35d4edfe17c0295c48883..69b6f521e6da3ee292c034763be5ad4b29ef8111 100644 (file)
     }
     
     /* We now direct our preview encode to fPreviewMoviePath */
-    fTitle->job->file = [fPreviewMoviePath UTF8String];
+    hb_job_set_file(fTitle->job, [fPreviewMoviePath UTF8String]);
     
     /* We use our advance pref to determine how many previews to scan */
     int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue];