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 E226D420AC for ; Tue, 22 Feb 2022 09:28:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A607A68B084; Tue, 22 Feb 2022 11:28:43 +0200 (EET) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E2CD68A703 for ; Tue, 22 Feb 2022 11:28:37 +0200 (EET) Received: by mail-yb1-f182.google.com with SMTP id e140so39698740ybh.9 for ; Tue, 22 Feb 2022 01:28:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cY99jre/8qhz3D7H+eQTBe49QgiQ6NFMa80ifIo9D0w=; b=XRrs1gpEfCRtuK4Z2af1QCUAEKXUX3USlCAJ5hDT7PUVzgxLwDg5/U4pinyP6+bYQJ eA8h2/NgLp6vG6c3G3/RA1Arn8YqHjRLVqOnDBYSTZACzAZdz81ekc5H3ehalV6pf710 cMUXE8ToMXYnNeS6/2jvO1v2I7KJ/rPyINbJunvps5SIuaAgrKdQNRQB7m+wChIYKN/t QRPZJKowvAt2HIUOoAxXgQA4Z9BoDaurqVpR8XqkFqkwmKw/RU759Lvq7kD+aGLU+rF9 TzoSBKfhaYcMHCI1y4BwvU8r03srWZUjLXpuQM4hZ/dEGOe6fnbmhiTufASo87S4d32G 3T+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cY99jre/8qhz3D7H+eQTBe49QgiQ6NFMa80ifIo9D0w=; b=zCoTrBPJafm/0F1ygWMqH6eWU9Zi9lrn7RdLKNgVBhj9iID2opcLGAFU1dMpKA9BGO vNPg3qKI3/dwrpCQI0S9gj0A52izSbR1JjHArrvA8a+lF7uuRqqCGUZ/GfsMlOU/GIpY BCEqIHOA2jd3VKiHwP6Z56FabnLM9fxaQRsCiiIgTAlLcLpUlcngYmHXu0Vn0S5uijl7 /DzgzqL/l4PNZUTcuCC6nfIQVjPcsRP3dBUGH2dGbzNTmccTA6//r8GuajHGt3MZOqw9 tytp0R93dFNLX/OTKfModRuccs/kYeXmyc90DjTf5qS3M2qDVFvwQEAWlpn9Xt1rc9n3 lSdw== X-Gm-Message-State: AOAM533+OX6CAy7ZX75ig1Fl37ma0hE0+/OE64QwQDwGHwRbfHS/NBVv 3AhuqPvAcq9gCwblNEjvNTKHIFYJOO05B3lvVrU= X-Google-Smtp-Source: ABdhPJxexv8JOEPW8itO43C5ugWpGVzeasQfwejzR75Wbo0hmFAsI/HI+Syp7IZ3L15e6kCJ2Vrk4pu2qwIUglnQqew= X-Received: by 2002:a25:ae92:0:b0:621:114b:f627 with SMTP id b18-20020a25ae92000000b00621114bf627mr3254485ybj.49.1645522115718; Tue, 22 Feb 2022 01:28:35 -0800 (PST) MIME-Version: 1.0 References: <20220222091446.2788957-1-jiasheng@iscas.ac.cn> In-Reply-To: <20220222091446.2788957-1-jiasheng@iscas.ac.cn> From: Paul B Mahol Date: Tue, 22 Feb 2022 10:30:04 +0100 Message-ID: To: Jiasheng Jiang X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avformat: Add check for ff_get_extradata 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 Cc: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, Feb 22, 2022 at 10:14 AM Jiasheng Jiang wrote: > On Tue, Feb 22, 2022 at 04:10:51PM +0800, Paul B Mahol wrote: > > >> As the potential failure of the memory allocation, the > ff_get_extradata() > >> could return error if fails. > >> Therefore, it should be better to deal with the return value of the > >> ff_get_extradata() and return error if fails. > >> > > > > > > Not really necessary. Does not fix anything. > > It is true that the 'extradata' could be NULL and have not used. > But I have checked many other callers of the ff_get_extradata(), > such as avi_read_header() in `libavformat/avidec.c`. > They all have checked the return value to guarantee the 'extradata' > to be non-NULL. > That means in the future, if the 'aix->extradata' is used, the programmer > may not notice that 'aix->extradata' is especial and needs to be checked > before use. > Therefore, I think it is necessary to add the check to guarantee the > consisitency of the code. > Nope, that does not make sense, it should always be checked. > > Thanks, > Jiang > > _______________________________________________ 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".