From 27c790c14c0d52a4e6278fa21ec02307875d40d7 Mon Sep 17 00:00:00 2001 From: David McPaul Date: Sun, 10 Aug 2008 13:52:32 +0000 Subject: [PATCH] handle invalid tracks better git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26913 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../media/plugins/mov_reader/mov_reader.cpp | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/add-ons/media/plugins/mov_reader/mov_reader.cpp b/src/add-ons/media/plugins/mov_reader/mov_reader.cpp index 1873571b96..691d7c8fa3 100644 --- a/src/add-ons/media/plugins/mov_reader/mov_reader.cpp +++ b/src/add-ons/media/plugins/mov_reader/mov_reader.cpp @@ -442,21 +442,23 @@ movReader::GetStreamInfo(void *_cookie, int64 *frameCount, bigtime_t *duration, { mov_cookie *cookie = (mov_cookie *)_cookie; - *frameCount = cookie->frame_count; - *duration = cookie->duration; - *format = cookie->format; + if (cookie) { + *frameCount = cookie->frame_count; + *duration = cookie->duration; + *format = cookie->format; - // Copy metadata to infoBuffer - if (theFileReader->IsVideo(cookie->stream)) { - const VideoMetaData *video_format = theFileReader->VideoFormat(cookie->stream); - *infoBuffer = video_format->theVOL; - *infoSize = video_format->VOLSize; - } else { - const AudioMetaData *audio_format = theFileReader->AudioFormat(cookie->stream); - *infoBuffer = audio_format->theVOL; - *infoSize = audio_format->VOLSize; + // Copy metadata to infoBuffer + if (theFileReader->IsVideo(cookie->stream)) { + const VideoMetaData *video_format = theFileReader->VideoFormat(cookie->stream); + *infoBuffer = video_format->theVOL; + *infoSize = video_format->VOLSize; + } else { + const AudioMetaData *audio_format = theFileReader->AudioFormat(cookie->stream); + *infoBuffer = audio_format->theVOL; + *infoSize = audio_format->VOLSize; + } } - + return B_OK; }