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 004584210D for ; Mon, 28 Mar 2022 21:16:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A6D668B2B0; Tue, 29 Mar 2022 00:16:19 +0300 (EEST) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8148768B245 for ; Tue, 29 Mar 2022 00:16:12 +0300 (EEST) Received: by mail-io1-f45.google.com with SMTP id k25so18710419iok.8 for ; Mon, 28 Mar 2022 14:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=/l6SWWa68OyvL6QqyUbw5UZX2H2tvEavPRpTq/kd2YQ=; b=QxnBtPlHYeqEEvuEIbBOA6bFfzaGS//uDLNVYDeczmQAhXCHrzzA7xkGoSCJ1W3EDf BsjiR070lGdyspcJ1B4c3O2wEkj1IaYEWN9N9iPDZ2q7fDimHDWYbyqrsx05KMzi8L/u iIpIUnaREksFb02PH7HjqW9M/uwB3V2bsYxjty/FXEI+Jd6TLMs6hEwgjxMiUVnZNjNp vWVIoCBwxeldn5Ps39jPKNKMmRVxTmceRm7UKNus04pk89avSMxyTVx0rXqIzibk80sx 1yDmzadrh+ofMHhyktSw7qiQ8pZ8I/KRusu500p/4W2Sx4IgdqBeE9boQoC+PPSYn1it AHNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=/l6SWWa68OyvL6QqyUbw5UZX2H2tvEavPRpTq/kd2YQ=; b=pCA7B0KqQdh2tuuXAbKuaYhtqvY4pDw2TshfT10BUtg0wM/953DTW8n7wRMaMyR4yA uLtoJUmTprs51erzX1wrkSnLzf/VrYPrD6k8P5OVifQvjaBHoXciOtZCQDVxTjyndO1V 0hleu9+nKUrTNgC7cjrbTR6d56fEauGKgPIqNUReivmKN6fouO9rfaDhKEVStoB5k0Wf IwZhxgtD9hEaJ/S4Go3xvA/s8kcLJE3EOyQrotOztFgwsADH+AWlAVYuMMeU+60hDt4X WGhojyTiMumuXeqAMvHln2koXjpQ6T4guRMLKyWo0lWbUnyS/h9V+gdevFYJI5qIuVSa FjQw== X-Gm-Message-State: AOAM530vJ8NV77F+lUvVlv801AMy0+dtbBcbao/IlYftSPi1rNxOW+1B WAPhtI4ZO1th5UVQgtKJGoXHBeFyCcQ= X-Google-Smtp-Source: ABdhPJxaIAU6cgXrPLZtSAfP+zDaZotqE0E/Rvcf+EEha0oqObQXlOzjN9F7YjS68eE9V4KbUad5Ag== X-Received: by 2002:a5d:84c1:0:b0:649:f07e:9c9c with SMTP id z1-20020a5d84c1000000b00649f07e9c9cmr7398466ior.33.1648502170860; Mon, 28 Mar 2022 14:16:10 -0700 (PDT) Received: from [192.168.1.35] (c-68-41-54-207.hsd1.mi.comcast.net. [68.41.54.207]) by smtp.gmail.com with ESMTPSA id m7-20020a056e02158700b002c61541edd7sm8418376ilu.3.2022.03.28.14.16.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Mar 2022 14:16:10 -0700 (PDT) Message-ID: <74e44665-37ed-bf5e-0ba4-7494706d2742@gmail.com> Date: Mon, 28 Mar 2022 17:16:09 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US-large To: ffmpeg-devel@ffmpeg.org References: <20220323110325.5499-1-leo.izen@gmail.com> <20220323110325.5499-3-leo.izen@gmail.com> From: Leo Izen In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v9 3/5] avcodec/libjxl: add Jpeg XL encoding via libjxl 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/23/22 11:08, Andreas Rheinhardt wrote: >> + temp = av_realloc(ctx->buffer, ctx->buffer_size); >> + if (!temp) { >> + av_freep(&ctx->buffer); > If you free this, you will be in a scenario where ctx->buffer is NULL, > yet ctx->buffer_size is > 0. This is inconsistent and might lead to > crashs in JxlEncoderProcessOutput. So don't free this and only set > buffer_size after the reallocation succeeded. Does it matter what ctx->buffer_size is if ctx->buffer is NULL? On 3/23/22 11:08, Andreas Rheinhardt wrote: > Unnecessary: av_freep() resets ctx->buffer and resetting buffer_size is > unnecessary. Here, you claim that resetting buffer_size is unnecessary but above you insist it is necessary. I'm confused here. Leo Izen (thebombzen) _______________________________________________ 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".