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 C6785420A7 for ; Tue, 22 Feb 2022 09:15:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 203AD68AF00; Tue, 22 Feb 2022 11:15:01 +0200 (EET) Received: from cstnet.cn (smtp23.cstnet.cn [159.226.251.23]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B779A6802AC for ; Tue, 22 Feb 2022 11:14:53 +0200 (EET) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-03 (Coremail) with SMTP id rQCowADX+JmIqRRivFD4AA--.39470S2; Tue, 22 Feb 2022 17:14:49 +0800 (CST) From: Jiasheng Jiang To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Feb 2022 17:14:46 +0800 Message-Id: <20220222091446.2788957-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: rQCowADX+JmIqRRivFD4AA--.39470S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Jr18trW7ury5tF13JFy5Jwb_yoWfWrg_uF y0qw1rJw4rWr47J3WDKr12yayvqr4rZrnFvr4Sqan7X34rWF9xXFyv9395Zr45J3y2qasx Gr9xAF1xtw4SvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbzxFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxG rwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4 vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcVC0I7IY x2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26c xKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x02 67AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbrMaUUUUUU== X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ 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: Jiasheng Jiang , onemda@gmail.com 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 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. 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".