From patchwork Thu Sep 19 22:17:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15162 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0F47F448A6F for ; Fri, 20 Sep 2019 01:30:53 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EC6A5689DA5; Fri, 20 Sep 2019 01:30:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 04C7B6881FA for ; Fri, 20 Sep 2019 01:30:46 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id a11so4804942wrx.1 for ; Thu, 19 Sep 2019 15:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AmP5BA8/u4uoS9KP3hbUSojqpX671zpMDJgU0jyzrIk=; b=HfeqfMXnZ7jy/gwIE8hHAI3i1okttQNbnUvoEdMCpTyX53CnTiPFok0JiLstdWKHpE ISl8c26aZ9703QFPQAXqnKWE0xkCNrp8efH6xDEoZMHNjUggk/pOVfFTHJlu5zd4G2wH nUI+kquJFrCMzSIbm8Y8aN/qcUKvehomhup76r+zcrLomHRn/S5foNE7vd67B6cQAlMb iCp2kyDInA1u0GAFRbodnSjjTBgST11Tu8LHGiEE1CipI0pRu5onvZXTVqBVrgd3NH0u LyuXzVmpeFp8vBHXiS/PUqUFFTW/blF5C5DlIw/kYxXo0Nl6moRdKAfdia2fujuor9GS DQiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AmP5BA8/u4uoS9KP3hbUSojqpX671zpMDJgU0jyzrIk=; b=alHz6aUcl5j1oGOuYHFJzDMvj2oKVs9UE0e/rIKl6wZg1XlPg1nV63MK+BwAcXApuf PJ0EBczOWY9AjRA9brZsnNLODa4TdwV1HXwtcbEkusptGktBbqbAApPCMPigMwwSkQbx UeWsuq3myG4qkPG34YzLX/NyapjLAhlUMMpf8zxs4qKQnAmF2sWEoHf1rEia7tYLga37 q4Jl0WkQCF25yxQTH9nVkyerQ8MgusbiqP2CrPejs03jJ6CMLzqF4UkKkQ3dUaMoUTRL ehRuZI/DtpSSJ5yYcFv5JtxDDQ3NPnyhG4k1phL6znJMUU6cDnTSetkVwjw+uHiJslSu PzyQ== X-Gm-Message-State: APjAAAWRQL6+3ZiToVJrF3jveGatcYqJXagNevTkckDMhb+fPT6/Jkbb E07cjfSh1kTVO+ka0IIRNRMO1e/L X-Google-Smtp-Source: APXvYqzi5ka4lOy7bq5P2kSioQd5ea/kUTwzjPTNHXcfUKWEqIrmLYlM6T7l23sPO6Oaet+EPVGScA== X-Received: by 2002:adf:eccd:: with SMTP id s13mr9075975wro.288.1568931868635; Thu, 19 Sep 2019 15:24:28 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc0f857.dynamic.kabel-deutschland.de. [188.192.248.87]) by smtp.gmail.com with ESMTPSA id y12sm49955wrn.74.2019.09.19.15.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 15:24:28 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Sep 2019 00:17:00 +0200 Message-Id: <20190919221706.16529-6-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190919221706.16529-1-andreas.rheinhardt@gmail.com> References: <20190919221706.16529-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/11] avformat/nutenc: Don't pass NULL to memcmp X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes lots of FATE tests, e.g. lavf-nut, as well as the nut part of ticket #7980. Signed-off-by: Andreas Rheinhardt --- This patch is made to match the previous behaviour; whether the previous behaviour is correct at all if the header length is zero is unknown to me. libavformat/nutenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index e9a3bb49db..dc714eb809 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -791,8 +791,9 @@ static int get_needed_flags(NUTContext *nut, StreamContext *nus, FrameCode *fc, flags |= FLAG_CHECKSUM; if (pkt->size < nut->header_len[fc->header_idx] || (pkt->size > 4096 && fc->header_idx) || - memcmp(pkt->data, nut->header[fc->header_idx], - nut->header_len[fc->header_idx])) + (nut->header_len[fc->header_idx] > 0 && + memcmp(pkt->data, nut->header[fc->header_idx], + nut->header_len[fc->header_idx]))) flags |= FLAG_HEADER_IDX; return flags | (fc->flags & FLAG_CODED);