From patchwork Fri Mar 19 05:58:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26472 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 C00E2449D11 for ; Fri, 19 Mar 2021 07:59:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7D74068A8B9; Fri, 19 Mar 2021 07:59:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7EB268A6B5 for ; Fri, 19 Mar 2021 07:59:42 +0200 (EET) Received: by mail-ed1-f42.google.com with SMTP id w18so9452397edc.0 for ; Thu, 18 Mar 2021 22:59:42 -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:reply-to :mime-version:content-transfer-encoding; bh=GU2dsgWqK/mobsV8NfKx95OZzLHx/CI7H+piHWdepys=; b=kNjCZ45jjnCty1ILF8gxqohn/uC/WlGmPe0fpXeWWVaufWYUofD5FVOelGNSP+Xl01 vYSZhrndF5nYT1YyE098aQcdS0PHLAevHdMrxX2gWjkkDyQnR1oHL83evffpbMRzl8UU Gvcl9KQelm+ivjFuhzSDWFq32rJZK/IF27KsN4QJI9iZuzYB0s8OZJTHPHQDt4uJV/FA vzQeRKE2YwrUupKy/9Uu9bVLwQQsCukVQZQcsjUF0VxIp56GrOcDC3AZz6bzGEdm/27e GOxsmzCLsC/GeFgTGcjqB8Ir41v/DxkMHNYSEDHE7WTJKYkIgkAI+nMzB/TrGcPZyPfO gFXw== 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:reply-to:mime-version:content-transfer-encoding; bh=GU2dsgWqK/mobsV8NfKx95OZzLHx/CI7H+piHWdepys=; b=jD5l7xxAwSid09g3h83czapo+3FtDU9YSAwZdaXVh12Daa2ematV4G8V6fzcRqsJqi 0bcDG1DCgALEoG6QmIC7k6TwJ8TG/YhiTdK8RIMkFm0gP22PoDgkj4T48d297Z5VTd87 mpaUssjFzYksyDdtjzBwkUH9jAA4rfAXb7Z7jDwh6pA+Af2iR1raCzK1r1ImA6ojkCeA 65b3iLJicBVLfpFC4X1FK5f2YFgmeokcyvo1RUIYxafTiy0B4znQIdwEplTIWNGZVVB9 K1xc9ahJDZgeGPB6CqhLFb5rhnasN7OJ/bM9uy43NKlBTppMqz9y7eW5Z7QA7KgdKdW2 ctUg== X-Gm-Message-State: AOAM533Aqis/4J991wUHKI6lXiQ8uU3r7RQY+SAjwjFIDof6vQLD9mfq wvaMWuyHG5R+Bg8rSRd9d8At2+LnuGLyuw== X-Google-Smtp-Source: ABdhPJxpJZREPRffg8bUKwQVfBiFlY37+FzHZS08A1VCiUXwh2AOu+0SUzxS52Zap0/amVR06tXQ+g== X-Received: by 2002:aa7:c353:: with SMTP id j19mr7618232edr.263.1616133582015; Thu, 18 Mar 2021 22:59:42 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc08960.dynamic.kabel-deutschland.de. [188.192.137.96]) by smtp.gmail.com with ESMTPSA id x17sm3109344ejd.68.2021.03.18.22.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 22:59:41 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Mar 2021 06:58:54 +0100 Message-Id: <20210319055904.2264501-8-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210319055904.2264501-1-andreas.rheinhardt@gmail.com> References: <20210319055904.2264501-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/18] avformat/ipmovie: Remove redundant av_packet_unref() 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" When one of these errors happens during ipmovie_read_packet(), an error is returned and the packet is cleaned up generically. And since 712d3ac539f30239b764d8621829dc9dc913da61 the same happens in ipmovie_read_header(). Signed-off-by: Andreas Rheinhardt --- libavformat/ipmovie.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index 3234d591da..26886d9592 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -194,7 +194,6 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, if (avio_read(pb, pkt->data + 8, s->video_chunk_size) != s->video_chunk_size) { - av_packet_unref(pkt); return CHUNK_EOF; } @@ -205,7 +204,6 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, if (avio_read(pb, pkt->data + 8 + s->video_chunk_size, s->decode_map_chunk_size) != s->decode_map_chunk_size) { - av_packet_unref(pkt); return CHUNK_EOF; } } @@ -217,7 +215,6 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, if (avio_read(pb, pkt->data + 8 + s->video_chunk_size + s->decode_map_chunk_size, s->skip_map_chunk_size) != s->skip_map_chunk_size) { - av_packet_unref(pkt); return CHUNK_EOF; } }