Do not use fWriter functions, when it has not been instantiated properly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32122 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-08-05 10:07:43 +00:00
parent 3471097486
commit 99304ab063
+5
View File
@@ -61,6 +61,7 @@ MediaWriter::~MediaWriter()
{ {
CALLED(); CALLED();
if (fWriter != NULL) {
// free all stream cookies // free all stream cookies
// and chunk caches // and chunk caches
StreamInfo* info; StreamInfo* info;
@@ -68,6 +69,7 @@ MediaWriter::~MediaWriter()
fWriter->FreeCookie(info->cookie); fWriter->FreeCookie(info->cookie);
_plugin_manager.DestroyWriter(fWriter); _plugin_manager.DestroyWriter(fWriter);
}
// fTarget is owned by the BMediaFile // fTarget is owned by the BMediaFile
} }
@@ -99,6 +101,9 @@ MediaWriter::CreateEncoder(Encoder** _encoder,
{ {
CALLED(); CALLED();
if (fWriter == NULL)
return B_NO_INIT;
// TODO: Here we should work out a way so that if there is a setup // TODO: Here we should work out a way so that if there is a setup
// failure we can try the next encoder. // failure we can try the next encoder.
Encoder* encoder; Encoder* encoder;