[M120 Migration][SVACE] Check stream before using 54/308554/3
authorzhishun.zhou <zhishun.zhou@samsung.com>
Wed, 27 Mar 2024 10:04:40 +0000 (18:04 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 28 Mar 2024 09:55:01 +0000 (09:55 +0000)
Several issues reported crash as null check missing
Add stream check before using

Patch from:
https://review.tizen.org/gerrit/#/c/301574/

Change-Id: I83328ff8bc530b15cd43aaa41ac477c553132bec
Signed-off-by: yanqing.lu <yanqing.lu@samsung.com
Signed-off-by: zhishun.zhou <zhishun.zhou@samsung.com>
media/filters/decrypting_demuxer_stream.cc

index 493b17e..14ab249 100644 (file)
@@ -423,6 +423,11 @@ void DecryptingDemuxerStream::DoReset() {
 }
 
 Decryptor::StreamType DecryptingDemuxerStream::GetDecryptorStreamType() const {
+  if (!demuxer_stream_) {
+    LOG(INFO) << "demuxer_stream is nullptr!";
+    return Decryptor::kStreamTypeMax;
+  }
+
   if (demuxer_stream_->type() == AUDIO)
     return Decryptor::kAudio;