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 B0964409B9 for ; Wed, 2 Feb 2022 01:58:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21D8C68B33B; Wed, 2 Feb 2022 03:58:16 +0200 (EET) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 00EE968B332 for ; Wed, 2 Feb 2022 03:58:09 +0200 (EET) Received: by mail-qk1-f179.google.com with SMTP id c189so16888381qkg.11 for ; Tue, 01 Feb 2022 17:58:09 -0800 (PST) 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=Lo2zNQCoacyWKg1YkGkNR0abnkgWYGkBFJMITArDAwI=; b=Cl8HewVO1f1+IwXrPsLEgYbaI/cTRqRJvPpgcVQy86Vs/3Tu6oS8xYUi83UAoDPZRW jFkaG2TM63eXVDV32I48loX0je4CRhKb3Y9yjX3psPbw9H1iBvHYLaENBvTQbFipxy2P pawvS9ktT+2CWRcr5ELd760gIzZcL9DyUWL/odsJUJHkP0XaxAcBPefKVv4A3mT06q/g YFQzbkj6XhmuHUnxcUy43Fvs0oe30vSJVcwW9u9Tu5r6hsoVkmDr5osr/zuU5njAkbXG BZeIIbOU0BWJVKIgExt+OGftEUPqQ2MKXmKB+7USNL7KS+sBg3n+VG4wnD+vT61JYXCW ZMhw== 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=Lo2zNQCoacyWKg1YkGkNR0abnkgWYGkBFJMITArDAwI=; b=iDiiy1Z88Hr7OhU4KiXz0MdOjagu8q46OvXpEQmcDCY0PZfwxCFdshv9iaCjCO5SeD Hu7pAJLWrvLuyIL7kZoo2kx2nt7aw0WKrMOFWfebnADlIvqmAlfDFdjabdPl8z4LB6wD KTiPs03D1opdNGlImZdWxcpjvy3jWTlYbRoNH63OLY/QdjVXe0lRAremPMa9Rhk4yKvy wgErxG9wStMAZy0QArXh4AEnrabm3LWlnCaKbW0cY43Hb2mhao8wN/Fs4pL0dJOKEk6E YDeAjzt6jDUpOk33oCiJ2stJxVCTxeKfHx0aGBADAiuMTqZljj7ujK9bfH9BOAvhIC/P G23A== X-Gm-Message-State: AOAM530Oqgigy2dmCKMDv63Wr5oGIjSy7Gd+Dha2/5FQWBWIV8oCA88j 4HC09UpWXHzM9DEvCwOv9G1a/mJ9Nps2vw== X-Google-Smtp-Source: ABdhPJxCNPE9bD8XRUWsUuL5TGIckzeZXEnW15iEekO45raorx7srYRenUht7FRi2D7GhSUVUItMUA== X-Received: by 2002:a37:8644:: with SMTP id i65mr19053097qkd.664.1643767088185; Tue, 01 Feb 2022 17:58:08 -0800 (PST) Received: from [192.168.1.64] ([151.200.235.219]) by smtp.gmail.com with ESMTPSA id g20sm12302213qko.27.2022.02.01.17.58.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Feb 2022 17:58:07 -0800 (PST) Message-ID: <816bc1cd-db7c-2091-5b13-6c54560110e4@gmail.com> Date: Tue, 1 Feb 2022 20:58:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220201223058.31090-1-scott.the.elm@gmail.com> From: Scott Theisen In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] lavu: make av_get_media_type_string() never return NULL 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 2/1/22 17:34, James Almer wrote: > This is an API breakage, so it's not ok. I'm new, so would this require a bump to the MINOR or MICRO version number? > The doxy states it returns NULL if media_type is unknown, so you're > expected to check the returned pointer before trying to use it. git grep -E --count "av_get_media_type_string" doc/APIchanges:1 doc/examples/demuxing_decoding.c:5 doc/examples/extract_mvs.c:2 fftools/cmdutils.c:1 fftools/cmdutils.h:1 fftools/ffmpeg.c:5 fftools/ffmpeg_opt.c:1 fftools/ffplay.c:2 fftools/ffprobe.c:3 libavcodec/avcodec.c:1 libavcodec/tests/avcodec.c:1 libavdevice/dshow.c:2 libavfilter/avfilter.c:2 libavfilter/avfiltergraph.c:2 libavfilter/src_movie.c:3 libavformat/avienc.c:1 libavformat/flvenc.c:1 libavformat/framehash.c:1 libavformat/mov.c:1 libavformat/mpegenc.c:1 libavformat/mpegts.c:1 libavformat/mxfdec.c:1 libavformat/segment.c:1 libavformat/tee.c:1 libavformat/uncodedframecrcenc.c:1 libavutil/avutil.h:1 libavutil/utils.c:1 44 total - 1 non-code - 1 prototype - 1 definition + 4 via macro - 1 macro = 44 uses The following uses of av_get_media_type_string() do not check for null: doc/examples/demuxing_decoding.c: 5 doc/examples/extract_mvs.c: 2 fftools/cmdutils.c: 2 via the define in cmdutils.h fftools/ffmpeg.c: 7, 2 via the define in cmdutils.h fftools/ffmpeg_opt.c:1 fftools/ffplay.c:2 libavfilter/avfiltergraph.c:2 libavfilter/src_movie.c:3 libavformat/flvenc.c:1 libavformat/framehash.c:1 libavformat/mov.c:1 libavformat/mpegenc.c:1 libavformat/mpegts.c:1 libavformat/mxfdec.c:1 libavformat/segment.c:1 libavformat/tee.c:1 32/44 uses do not check for null. libavcodec/tests/avcodec.c: this use is a workaround to av_get_media_type_string() returning null; checked 3 times Let me know which version number to bump and I will submit a new version that also removes the now redundant null checks from the rest of the code. Thanks, Scott _______________________________________________ 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".