OSDN Git Service

Don't crash HB when the video decoder (MPEG2 or ffmpeg) doesn't understand the format...
authoreddyg <eddyg@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 12 Aug 2008 01:55:30 +0000 (01:55 +0000)
committereddyg <eddyg@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 12 Aug 2008 01:55:30 +0000 (01:55 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@1626 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/scan.c

index 5cc0b41..de4d565 100644 (file)
@@ -494,7 +494,16 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title )
         /* Get size and rate infos */
 
         hb_work_info_t vid_info;
-        vid_decoder->info( vid_decoder, &vid_info );
+        if( !vid_decoder->info( vid_decoder, &vid_info ) )
+        {
+            /*
+               * Could not fill vid_info, don't continue and try to use vid_info
+               * in this case.
+               */
+            vid_decoder->close( vid_decoder );
+            free( vid_decoder );
+            continue;
+        }
         vid_decoder->close( vid_decoder );
         free( vid_decoder );