From patchwork Thu Aug 31 18:07:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wachsler X-Patchwork-Id: 4929 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1853754jao; Thu, 31 Aug 2017 11:15:33 -0700 (PDT) X-Received: by 10.28.47.21 with SMTP id v21mr996406wmv.90.1504203333400; Thu, 31 Aug 2017 11:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504203333; cv=none; d=google.com; s=arc-20160816; b=e5gNi9U/k1ugOenRObEoXRpNBLfyh8KM1x+6PekiR5iZryDHjnxivdfs2PlMl08dA2 V+6Ye5bwX83ZdnVYyUFvbbCws8M5fVYQQmnQ1MjtwS5R7NmU1KjxduO6Xcm4kn9CnjtQ X4bPf6WLkQS/zAOXFXzp9fWerxugfKgtxNRSBqobO2vxJjs7i4TY88XG0RYbHCZjJS1M aV9WlaSUM/FvrS/Jm9X9vKMexk8lbSaOUCcB0lXS0pJGxQ1MprCCCw/F6ItOzufGi4Vj 1yGSkS+IWROQUmFfTl2rf7/IV8BHNRinH7CEBGspcCJx301kgxBlDhwfKHehKpJPklLF 7cXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=EFRri+1ymOK2MjFuxGlgbO2ClD64srWFRU0/Ifvy9SY=; b=HdQ3nFO3gthH+pzJKVFyZ38BUumLlC/+Nt3jC6NIc60zXEkkgFROA1SNeP/asrkGcI atL4uvAI8iNecSf9imD6NQo0oSF2jkqXPiL5als8guc65fBa9RAVRjDqKaqrwLIFVFA+ zQdljaKP9mOLF3AqUrqE7QfWlZcPYCmIebMxcvvBCc+gxHK1tNya9tyxdZaV3BO2e80G IbG/Cv/Tuzb69lRsFS96YqJtBVJUa8zhs2aKPbAZJw3MTP4SHukezQVpuB0hx9l9UnEV CH/J0Kat5VsxNoCYcRohfYwIGqHncK6nxSKKLvlsd2U4yHVMXyGVmQDMluWlI9FFrHI3 B33w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=dd2nFVN1; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x189si530428wmd.273.2017.08.31.11.15.32; Thu, 31 Aug 2017 11:15:33 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=dd2nFVN1; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 732CF68A1CA; Thu, 31 Aug 2017 21:15:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D4E968A175 for ; Thu, 31 Aug 2017 21:15:23 +0300 (EEST) Received: by mail-qk0-f180.google.com with SMTP id k126so1790734qkb.4 for ; Thu, 31 Aug 2017 11:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BcqJT3QOSZUa2jBJ5h1Hom9a2lXp09L76tyQzLaX6+4=; b=dd2nFVN115F/9pjG3gIRST2ET8pxMtX8GUDW5Ib1h/TdjghaGQic7uI+Rztpt5DXpY yFF4lGpHohlwv42CWzif95A4PKSjJPGfhfSx98STzPEesC/uxb507LTvCII4SqIHNOPK HMSVFAOIgoBV7ZT40++RWFykpSxDIM1kxzA8bI/0P0zn+c3GTF3h/Dcdy4x3vllrk6mB uilSOwvqB1TEvMnVGtlsGAf1SKtKKRiKsLv3Ejufw2dVTjpyYLWIZNWZ29pu0EVni8+3 HC6nyObW3pmiH/pVPNraJen4w34blLlUgOj/BxEpQAeVYUDdGrPT0iNEeNxvL+A1yZqo 8mMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BcqJT3QOSZUa2jBJ5h1Hom9a2lXp09L76tyQzLaX6+4=; b=h+/VWyNRw3fuhWh2qLkVJcDRZtCUSa4JOodlO5Cp5PqDY7111VAr3ONIlTCnuXSdQC uCC78qEkeLK5/iKNY8HKYxz5NnITLKJ0NPqilfl9ckrz7wueZ+tLvD9oPYACZNOXW5Ou xK1f5U2TFHrqUgw9CAoH/JA9R8B4+ckNpAPOtD1l5Q3tSM1Xt8JVTScVwTmi1zQs9a4v h9OHPRL8A4Y+Blgfc1N66i+M6jU9zHlndk0g2lZfSPsg3ErVW5CqeX8/6lVufVM5j0PG RdTjeIPMxCC9zPxYdoCAJa+AzdyzlNERUnamn8LDlgzJFTX7rGcAzUK0kbafZ+4fq5qq RCcg== X-Gm-Message-State: AHPjjUgpSl1+9nIXmfYY+D30DOYBOFdnLQqR7SYpx/7nEFVZtcH+xd4o e6JR/+fNPs+oj6oytYOoEw== X-Google-Smtp-Source: ADKCNb4xPCiBy71RNPLybYwrgXRpSMXpopLC0iPzv1usCVWtctlZpGs/+2pQRn5SxioQWNdfDilyWA== X-Received: by 10.55.220.130 with SMTP id v124mr4770656qki.95.1504202876003; Thu, 31 Aug 2017 11:07:56 -0700 (PDT) Received: from quechee.cam.corp.google.com ([172.23.221.16]) by smtp.gmail.com with ESMTPSA id x8sm222395qta.94.2017.08.31.11.07.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Aug 2017 11:07:55 -0700 (PDT) From: Mark Wachsler To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Aug 2017 14:07:43 -0400 Message-Id: <20170831180743.10311-1-wachsler@google.com> X-Mailer: git-send-email 2.14.1.581.gf28d330327-goog Subject: [FFmpeg-devel] [PATCH] avcodec/mov: Allocate skipped_bytes_pos with av_realloc. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Mark Wachsler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Memory reallocated with av_reallocp_array is supposed to be allocated with av_realloc, not av_malloc. --- libavcodec/h2645_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c index b0d9ff66f0..1b2534b2e6 100644 --- a/libavcodec/h2645_parse.c +++ b/libavcodec/h2645_parse.c @@ -318,7 +318,8 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, nal = &pkt->nals[pkt->nb_nals]; nal->skipped_bytes_pos_size = 1024; // initial buffer size - nal->skipped_bytes_pos = av_malloc_array(nal->skipped_bytes_pos_size, sizeof(*nal->skipped_bytes_pos)); + nal->skipped_bytes_pos = av_realloc(NULL, nal->skipped_bytes_pos_size * + sizeof(*nal->skipped_bytes_pos)); if (!nal->skipped_bytes_pos) return AVERROR(ENOMEM);