diff options
author | jstebbins <[email protected]> | 2010-09-14 23:08:57 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-09-14 23:08:57 +0000 |
commit | be3a03fca39d47d391efa36894124fc2e87eb5de (patch) | |
tree | b2661619896ca99e33ebfd33f2f9f0b20fe1245c /libhb/decavcodec.c | |
parent | 919590e39871a63b726ee47cd705b7754a469b91 (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.c | 7 |
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 |