From ac847fc895473824acd118d4f99ed0a07841e7aa Mon Sep 17 00:00:00 2001 From: David McPaul Date: Sat, 16 Aug 2008 02:24:19 +0000 Subject: [PATCH] Don't call Reader methods with invalid cookies git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26986 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/MediaExtractor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kits/media/MediaExtractor.cpp b/src/kits/media/MediaExtractor.cpp index 2e2a483b5f..70860ad653 100644 --- a/src/kits/media/MediaExtractor.cpp +++ b/src/kits/media/MediaExtractor.cpp @@ -151,6 +151,9 @@ int64 MediaExtractor::CountFrames(int32 stream) const { CALLED(); + if (fStreamInfo[stream].status != B_OK) + return 0LL; + int64 frameCount; bigtime_t duration; media_format format; @@ -168,6 +171,10 @@ bigtime_t MediaExtractor::Duration(int32 stream) const { CALLED(); + + if (fStreamInfo[stream].status != B_OK) + return 0LL; + int64 frameCount; bigtime_t duration; media_format format;