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 7A59E4BAD8 for ; Sat, 13 Jul 2024 15:51:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03BBE68DB96; Sat, 13 Jul 2024 18:51:14 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 16E7568D9E2 for ; Sat, 13 Jul 2024 18:51:07 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6BEB21C0005 for ; Sat, 13 Jul 2024 15:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720885866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=BeKaJwR+U2c73fJdnRqaYp8ez9HXTb6ktgeYgyakjrE=; b=HHrBpH2751nBeooIXVHjsV6RW0rsPHtfUecHTXAB8YaRt9V+KS53nAIvx7T5ZvaPcN/zoF 66uj9WMKBcoKpg0ivAQisDvs3AInGNJlqtZ0hA4Lc4fh96OKlwiNTmn9SdM8xLRwDgyq7f z7hybpY+z5uQ0ZD4SPeBjCtuzbwzrHpmdLTPXKHOoBc4Q/RliMaMKaEJoc6fUZ/IWZVFk4 F3ZH9HE8ODBFIdxaj5A67d+lqyMRi2upX/vgY8I0SPPxWe5qJDAVSA6FLjTCcw05/sf5Yd 03EAOiht1l8lk165aCCfUe8saQZxwogdvX8rmZz5A8YW7AdqHawxaLrYKM97nQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 13 Jul 2024 17:51:03 +0200 Message-ID: <20240713155105.2161442-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/3] avformat/lmlm4: Move subtraction after 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This is not a bugfix in code but coverity only, it does look a little nicer though Fixes: CID732224 Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/lmlm4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c index 209b544ccd8..c8355e7a8d6 100644 --- a/libavformat/lmlm4.c +++ b/libavformat/lmlm4.c @@ -91,7 +91,6 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) frame_type = avio_rb16(pb); packet_size = avio_rb32(pb); padding = -packet_size & 511; - frame_size = packet_size - 8; if (frame_type > LMLM4_MPEG1L2 || frame_type == LMLM4_INVALID) { av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n"); @@ -102,6 +101,7 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(EIO); } + frame_size = packet_size - 8; if ((ret = av_get_packet(pb, pkt, frame_size)) <= 0) return AVERROR(EIO); -- 2.45.2 _______________________________________________ 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".