From patchwork Sun Nov 13 18:44:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 39254 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp2041807pzb; Sun, 13 Nov 2022 10:44:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7liiRmFRTjC2Ef5Z4X1AkrpAYKebeq/ur2+apRVQCXP8qmxDf0TH7sohjdqhEnjNduk0fm X-Received: by 2002:a17:906:7fd8:b0:7ad:902c:d1d6 with SMTP id r24-20020a1709067fd800b007ad902cd1d6mr7897713ejs.143.1668365093383; Sun, 13 Nov 2022 10:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668365093; cv=none; d=google.com; s=arc-20160816; b=g7M/98k0SV0md4ZyucYcOV0vgFtWm+j6nDLqOghdgeJNzb8NmMC/R+Fhk5PA7Pc+W8 oziudkmjo82ycEQR/mpvls2tHJ5bv8JX1BhDgPHETHW9IIFOsNvo5g+x4Nqb6L+iS9ON vGQK9JdtBhp3te4GmGtycPopOZbKtT7jMpW2egfrM20W5enbRHkKelO1t4+E40DsgEYl YmhOb1Fg8R5WPqd5+OZUA+OOXi5X28A8g/eyptgoC/oqfYURCfZlySWELPRV8uv3qnmO TMb1DhfyAbrCOma3nq/pKc3K2IM1iyzSTUuyvEDSiY2hkXU75NHmHIzA8bGeX5Zt8nJK 5uDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=jxXzZ/SxR27t3/D0vzDrBKnhDD18vjx5aTAMPaT0F9w=; b=YT43dZcQY4uWX3WB9HCBER0Lo/w6W3uNw4Ixl7wVRIXv4Q7JvFi0x7/IjEpFeV4KvX GXV3DOHeMwLJ+DSfyeiu1KZBYGUMDcwaBu+o5vgQGNgSf1v4/r2oqxujMTMzWyTG5ZIK l9kzRciiKRXwlGbMPYge917UeDzTNliccKy2V37OPEzmLY4eikMF5TebuQkqZkGRHtZ5 +AMlFBZXxrcQ+DT/GtfliBVr6uE4Qv/doZQvLqpm/oesycawCHmbJrVQCzr/8K/Z/cLm UgzgqQ0uasSDM7PBqAr7agxxyk3X7de4t4J2qA9GmvLZs/9FY6CN/DWaDXip7UyNZr+T vrEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e17-20020a17090658d100b007a92b00c094si4842451ejs.421.2022.11.13.10.44.52; Sun, 13 Nov 2022 10:44:53 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5965668B22C; Sun, 13 Nov 2022 20:44:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7473868B22C for ; Sun, 13 Nov 2022 20:44:46 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 8338BE75DA; Sun, 13 Nov 2022 19:44:44 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D94rN8icAlhj; Sun, 13 Nov 2022 19:44:43 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id C0707E710F; Sun, 13 Nov 2022 19:44:42 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 13 Nov 2022 19:44:39 +0100 Message-Id: <20221113184441.1741-1-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avformat/electronicarts: fix EOF check 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bcuaSPBPob2c Similar to feof(), avio_feof() is only true after an actual overread. Signed-off-by: Marton Balint --- libavformat/electronicarts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index e7f0cb9b9e..0a0d6249e8 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -582,9 +582,9 @@ static int ea_read_packet(AVFormatContext *s, AVPacket *pkt) int av_uninit(num_samples); while ((!packet_read && !hit_end) || partial_packet) { + chunk_type = avio_rl32(pb); if (avio_feof(pb)) return AVERROR_EOF; - chunk_type = avio_rl32(pb); chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb); if (chunk_size < 8) return AVERROR_INVALIDDATA;