summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-09-14 23:08:57 +0000
committerjstebbins <[email protected]>2010-09-14 23:08:57 +0000
commitbe3a03fca39d47d391efa36894124fc2e87eb5de (patch)
treeb2661619896ca99e33ebfd33f2f9f0b20fe1245c /libhb/decavcodec.c
parent919590e39871a63b726ee47cd705b7754a469b91 (diff)
fix a crash when a TS has no aspect ratio set in the video stream
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3529 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index f5c46699e..abf7ed179 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -977,10 +977,11 @@ static int decavcodecvInfo( hb_work_object_t *w, hb_work_info_t *info )
if ( info->pixel_aspect_width == 0 ||
info->pixel_aspect_height == 0 )
{
+ // There will not be an ffmpeg stream if the file is TS
AVStream *st = hb_ffmpeg_avstream( w->codec_param );
- info->pixel_aspect_width = st->sample_aspect_ratio.num ?
- st->sample_aspect_ratio.num : 1;
- info->pixel_aspect_height = st->sample_aspect_ratio.den ?
+ info->pixel_aspect_width = st && st->sample_aspect_ratio.num ?
+ st->sample_aspect_ratio.num : 1;
+ info->pixel_aspect_height = st && st->sample_aspect_ratio.den ?
st->sample_aspect_ratio.den : 1;
}
/* ffmpeg returns the Pixel Aspect Ratio (PAR). Handbrake wants the