Fix crash in FlushOnWorkerThread 91/291691/1 accepted/tizen/7.0/unified/20230424.020500
authorzhishun.zhou <zhishun.zhou@samsung.com>
Thu, 20 Apr 2023 08:29:51 +0000 (16:29 +0800)
committerzhishun.zhou <zhishun.zhou@samsung.com>
Thu, 20 Apr 2023 08:41:19 +0000 (16:41 +0800)
Once the function of FlushOnWorkerThread has been called after
the reset of frame_cb_, crash will happened.

Change-Id: I89f64aca0eabae2f7f0dcb1fe35491efb2bc3371
Signed-off-by: zhishun.zhou <zhishun.zhou@samsung.com>
tizen_src/chromium_impl/media/blink/mm_video_decoder.cc

index f7e78397469f3074e70d21420510d10cedf63c52..1ee113932dd16c54496c9a41e809d8a183f6893f 100644 (file)
@@ -340,6 +340,8 @@ void MMVideoDecoder::FlushOnWorkerThread() {
                player_id_.load(), "frames_to_flush", frames_to_flush.size());
   {
     base::AutoLock lk(release_lock_);
+    if (!frame_cb_)
+      return;
     for (const auto& frame : frames_to_flush) {
       frame_cb_.Run(nullptr, frame.timestamp);
     }