From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AB280457E7 for ; Fri, 24 Mar 2023 13:02:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6DC4368C7BC; Fri, 24 Mar 2023 15:02:44 +0200 (EET) Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A00768C758 for ; Fri, 24 Mar 2023 15:02:38 +0200 (EET) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-17997ccf711so1695935fac.0 for ; Fri, 24 Mar 2023 06:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679662956; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KaJ6u+EHaMFJAiht/JHbSdJRxav6qVsDTAvuqHdVJ48=; b=SDTAjcP8Bc//hd9pMmiNyjyBEV1/0y2I55GtTtcGsJ5ieVKedJG4oHcTXOO7lBI7rP eXjWMdSoJY+KU/1O54MpUsXTgJLeC096yOIkir7IpxU6zLO0hTjKVTf8X0lcwtU7xuqw wfCQ/c9HlXU9cEtn3UTV8fHnj8CHGURX/O6lqIBPXv8xj5lIUKo/YiV/OLz3vl3CLtSc uikV5YRcfOVxo2V8XY5CA5FZxQh3ea9S5YQg3SYf8AhkT5ITLVjbl3flMl4DbjQdQy0O TO875yoeg45+WMrQ9MLvwM2yudoZixAeJYT34EI7b5s0bThdyYw/5IVZrqwF/oizjp0V D6/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679662956; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KaJ6u+EHaMFJAiht/JHbSdJRxav6qVsDTAvuqHdVJ48=; b=8LSn8F2sLYkEOXcZXyK/GkmUrnusJOXD4ZWlK5HgBX+TQr47a4vHje7r0mU3tL/no9 0TAyGgw7mOYlUBjaUdflrlhfmciAIjHnUYPHIuGpHbH9ZGVGq+5sTngcOQ7ErwLlNb4d E5dQfbRM1+kd3MLHQZUxdLlntmWIMaZORLs/a8cm8IzgwRg/qVy8qhfZAWdCVs/8WgMQ 0o15MRy5LvBEGxggX/h2qFwHbxNuoKjDJr2AIpqcuuPwvqXahvRCtNmmiBMdhroYbvv+ CdB5LSi/hz7abGYfdQzwioenSxvFkSnCpDUwd/Rc6dGNfo5UfM+CBw452DWYPUowT5at DFFQ== X-Gm-Message-State: AO0yUKUIZ71rFleZuExCKMuQN5gmAKdmR35v9l6o6SBye5fNVlw+u/4Q tmqGGa8Z5FBBrAf36tYZThzBBN8pdfk= X-Google-Smtp-Source: AK7set+pFd6a8sg1pWw/2LGLsj5NekWcxFm8Nog4y9Td2AF3uJgrKxrwCZF4xXCMd6WemOy+2qycow== X-Received: by 2002:a05:6871:1c8:b0:17a:c7ff:ccf5 with SMTP id q8-20020a05687101c800b0017ac7ffccf5mr2092707oad.32.1679662956182; Fri, 24 Mar 2023 06:02:36 -0700 (PDT) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id f15-20020a9d5f0f000000b0068bd6cf405dsm6384014oti.1.2023.03.24.06.02.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 06:02:33 -0700 (PDT) Message-ID: <41a53887-5b12-6be0-9359-9e807ba21689@gmail.com> Date: Fri, 24 Mar 2023 10:02:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230320233408.134255-1-jeebjp@gmail.com> <20230320233408.134255-3-jeebjp@gmail.com> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v0 02/14] avcodec: move AVCodecInternal allocation to avcodec_alloc_context3 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 3/24/2023 9:07 AM, Andreas Rheinhardt wrote: >> @@ -174,6 +190,8 @@ void avcodec_free_context(AVCodecContext **pavctx) >> >> avcodec_close(avctx); >> >> + av_freep(&avctx->internal); > Moving this to avcodec_free_context() creates a leak when using > avcodec_close()+av_free(). This can be fixed by allocating the > AVCodecContext and the AVCodecInternal jointly. Can't we just declare that doing av_free() on a AVCodecContext is not a valid API usage? Every other struct with an specific free function is very clear about it being the only way to free them. > >> + >> av_freep(&avctx->extradata); >> av_freep(&avctx->subtitle_header); >> av_freep(&avctx->intra_matrix); _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".