From b3622b35243f92f3fd62548afa85028372ef756f Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sat, 6 Oct 2012 19:49:09 +0200 Subject: [PATCH] Fix segfault in audioomx --- audioomx.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audioomx.cc b/audioomx.cc index 031adb0..6fed499 100644 --- a/audioomx.cc +++ b/audioomx.cc @@ -1488,6 +1488,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, } + if (*samplepos>packet.length) *samplepos=0; //propably the thread got interrupted and sample is not valid any more! unsigned int haveToCopy=packet.length-*samplepos; if (passthrough) { //TODO @@ -1550,6 +1551,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, }; if (adv > 0) { incoming_paket_libav.data += adv; + incoming_paket_libav.size-=adv; haveToCopy -= adv; *samplepos += adv; /*if (current_context->frame_size>0) framesize=min(current_context->frame_size,haveToCopy); -- 2.39.2