OSDN Git Service

stagefright-plugins: Protect against crash
authorSteve Kondik <steve@cyngn.com>
Sat, 2 Jan 2016 16:40:06 +0000 (08:40 -0800)
committerSteve Kondik <steve@cyngn.com>
Sat, 2 Jan 2016 16:40:06 +0000 (08:40 -0800)
 * If the queue has been aborted, don't derefernce NULL pointers.

Change-Id: I1a04216da11cf71cbe78a315d7aef3224bb11162

utils/ffmpeg_utils.cpp

index 0136074..d02ea61 100644 (file)
@@ -366,6 +366,10 @@ void packet_queue_flush(PacketQueue *q)
 {
     AVPacketList *pkt, *pkt1;
 
+    if (q->abort_request) {
+        return;
+    }
+
     Mutex::Autolock autoLock(q->lock);
     for (pkt = q->first_pkt; pkt != NULL; pkt = pkt1) {
         pkt1 = pkt->next;