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 7CC0A40416 for ; Wed, 23 Feb 2022 13:12:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F9A868B117; Wed, 23 Feb 2022 15:12:36 +0200 (EET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 963A468AF85 for ; Wed, 23 Feb 2022 15:12:29 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 7F4DA24000A for ; Wed, 23 Feb 2022 13:12:28 +0000 (UTC) Date: Wed, 23 Feb 2022 14:12:27 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220223131227.GC2829255@pb2> References: <20220223023159.2789586-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 In-Reply-To: <20220223023159.2789586-1-jiasheng@iscas.ac.cn> Subject: Re: [FFmpeg-devel] [PATCH v4] avformat/nutdec: Add check for avformat_new_stream 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-Type: multipart/mixed; boundary="===============4200224383095787908==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4200224383095787908== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ASiRtCI/0OTt1yoX" Content-Disposition: inline --ASiRtCI/0OTt1yoX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 23, 2022 at 10:31:59AM +0800, Jiasheng Jiang wrote: > As the potential failure of the memory allocation, > the avformat_new_stream() could return NULL pointer. > Therefore, it should be better to check it and return > error if fails. > Also, the caller, nut_read_header(), needs to deal with > the return value of the decode_main_header() and return > error if memory allocation fails. > And 'time_base_count' has already checked and it > will return AVERROR_INVALIDDATA if fails, which is different > from ENOMEM. >=20 > Fixes: 619d8e2e58 ("updating nut demuxer to latest spec no muxing yet no = index yet no seeking yet libnuts crcs dont match mine (didnt investigate ye= t) samplerate is stored wrong by libnut (demuxer has a workaround) code is = not clean or beautifull yet, but i thought its better to commit early befor= e someone unneccesarily wastes his time duplicating the work demuxer split = =66rom muxer") > Signed-off-by: Jiasheng Jiang > --- > Changelog: >=20 > v1 -> v2 >=20 > * Change 1. Add the error handling for ENOMEM from decode_main_header() > in nut_read_header(). > * Change 2. Check for the 'time_base_count'. >=20 > v2 -> v3 >=20 > * Change 1. Remove the check for 'time_base_count'. > * Change 2. Change the av_free to av_freep. >=20 > v3 -> v4 >=20 > * Change 1. Remove the av_freep. > --- > libavformat/nutdec.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato --ASiRtCI/0OTt1yoX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYhYytwAKCRBhHseHBAsP q2hXAJ9goNCGXVjLRvpHeMjjQAAvNT3K1gCeIXCiz5RGvz8Hs+mG3nOjgmSVvWQ= =FyCJ -----END PGP SIGNATURE----- --ASiRtCI/0OTt1yoX-- --===============4200224383095787908== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============4200224383095787908==--