From 9e4364f672d7fdace903477b560d6d5c1c8e2b21 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 21 Nov 2013 13:05:01 -0500 Subject: [PATCH] Fix the double-free bug and disable double free debugging. --- src/com/limelight/nvstream/av/AvByteBufferPool.java | 2 +- src/com/limelight/nvstream/av/AvObjectPool.java | 2 +- src/com/limelight/nvstream/av/AvShortBufferPool.java | 2 +- src/com/limelight/nvstream/av/video/AvVideoDepacketizer.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/limelight/nvstream/av/AvByteBufferPool.java b/src/com/limelight/nvstream/av/AvByteBufferPool.java index 0fe652af..8cfbcc5a 100644 --- a/src/com/limelight/nvstream/av/AvByteBufferPool.java +++ b/src/com/limelight/nvstream/av/AvByteBufferPool.java @@ -6,7 +6,7 @@ public class AvByteBufferPool { private ConcurrentLinkedQueue bufferList = new ConcurrentLinkedQueue(); private int bufferSize; - private static final boolean doubleFreeDebug = true; + private static final boolean doubleFreeDebug = false; public AvByteBufferPool(int size) { diff --git a/src/com/limelight/nvstream/av/AvObjectPool.java b/src/com/limelight/nvstream/av/AvObjectPool.java index d751be98..1bde62cc 100644 --- a/src/com/limelight/nvstream/av/AvObjectPool.java +++ b/src/com/limelight/nvstream/av/AvObjectPool.java @@ -5,7 +5,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; public class AvObjectPool { private ConcurrentLinkedQueue objectList = new ConcurrentLinkedQueue(); - private static final boolean doubleFreeDebug = true; + private static final boolean doubleFreeDebug = false; public void purge() { diff --git a/src/com/limelight/nvstream/av/AvShortBufferPool.java b/src/com/limelight/nvstream/av/AvShortBufferPool.java index 9f7a956c..84939ca1 100644 --- a/src/com/limelight/nvstream/av/AvShortBufferPool.java +++ b/src/com/limelight/nvstream/av/AvShortBufferPool.java @@ -6,7 +6,7 @@ public class AvShortBufferPool { private ConcurrentLinkedQueue bufferList = new ConcurrentLinkedQueue(); private int bufferSize; - private static final boolean doubleFreeDebug = true; + private static final boolean doubleFreeDebug = false; public AvShortBufferPool(int size) { diff --git a/src/com/limelight/nvstream/av/video/AvVideoDepacketizer.java b/src/com/limelight/nvstream/av/video/AvVideoDepacketizer.java index 646b0b7d..3bdddcc0 100644 --- a/src/com/limelight/nvstream/av/video/AvVideoDepacketizer.java +++ b/src/com/limelight/nvstream/av/video/AvVideoDepacketizer.java @@ -125,7 +125,7 @@ public class AvVideoDepacketizer { } // Construct the H264 decode unit - AvDecodeUnit du = AvDecodeUnit.newDecodeUnit(AvDecodeUnit.TYPE_H264, avcNalDataChain, avcNalDataLength, flags); + AvDecodeUnit du = AvDecodeUnit.newDecodeUnit(AvDecodeUnit.TYPE_H264, new LinkedList(avcNalDataChain), avcNalDataLength, flags); if (!decodedUnits.offer(du)) { releaseDecodeUnit(du);