OSDN Git Service

add check for reasonable vobsub width/height values when parsing out of mp4
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 30 May 2010 18:22:32 +0000 (18:22 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 30 May 2010 18:22:32 +0000 (18:22 +0000)
if the values aren't good, use default of 720x480

git-svn-id: svn://localhost/HandBrake/trunk@3338 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/stream.c

index f4f5ae3..35b705a 100644 (file)
@@ -2928,8 +2928,16 @@ static int ffmpeg_parse_vobsub_extradata_mp4( AVCodecContext *codec, hb_subtitle
             codec->extradata[j+2] << 8  |   // Cb
             codec->extradata[j+3] << 0;     // Cr
     }
-    subtitle->width = codec->width;
-    subtitle->height = codec->height;
+    if (codec->width <= 0 || codec->height <= 0)
+    {
+        subtitle->width = 720;
+        subtitle->height = 480;
+    }
+    else
+    {
+        subtitle->width = codec->width;
+        subtitle->height = codec->height;
+    }
     return 0;
 }