summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-05-30 18:22:32 +0000
committerjstebbins <[email protected]>2010-05-30 18:22:32 +0000
commit0697b4f8b2b066d6adc7932589a18f0f850be5c7 (patch)
tree9f30a40913067209e68d117ae6d9e7fcc011e449
parent6c2ab0ec0cef0c3f6cc2771ad28a3d86b8df61e0 (diff)
add check for reasonable vobsub width/height values when parsing out of mp4
if the values aren't good, use default of 720x480 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3338 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/stream.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index f4f5ae3fa..35b705af4 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -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;
}