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 01719407C0 for ; Tue, 1 Feb 2022 01:57:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEB8D68B157; Tue, 1 Feb 2022 03:57:47 +0200 (EET) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DFA9B68AFC9 for ; Tue, 1 Feb 2022 03:57:40 +0200 (EET) Received: by mail-ot1-f42.google.com with SMTP id o9-20020a9d7189000000b0059ee49b4f0fso14793222otj.2 for ; Mon, 31 Jan 2022 17:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=OHK0RmFLwdm1VHZCqeaUfJntLvhQMs6QLJWL+VQFTj8=; b=FYE8bLXrZJSun/ps4FYl2y5Pw/hh2Q32O/YQ1y4McE07xFMF4BaZ6jxxQLjKfptKRY li8q4Q1Sub1+mbiTyjEQIaQDNr4UqJhrMsM2Ew5oZi3Ic7T06O4GYXFfZW719L/Vo4pV fnXaVTghtrOXqID3H/xx3v0ghLkU/WR/klPd7HE6pikBjeHfitWN632SBqrfuQITypJ0 gmS2RIDCVw4MPxcTDh07GOoeb1MvbgZxx2pbLMgeQkEMvq3t4w9RN0Mc8QzzCQVkygKI lhH7h8pImkGYY69F2trNbYiPOFFXhJYYorLfwVHT59NzncCrp6nOmqc2CNuMOHmTl799 pKOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=OHK0RmFLwdm1VHZCqeaUfJntLvhQMs6QLJWL+VQFTj8=; b=cKdojrmaj+3vK6hzsjej+XdmlT9CKqek/fsgkFCUW6hvB9U6Wb3lEqQk0ViD0fNa3W 1xe9du94nuh8pgcveKqgdLOF6swN84I4/wUzZk6THiuxPVTuiDaSxUgMdHs0O56/Mcof ca71bbSshEBtxEYOFZPDQrSVTx4mzxJsVuqI+7/ICoHajUDmK3IzNGT5irvwV/jFjgZ7 MwCUWmYQgqZSF2syEicUVvF3+oQDHKRL4azAyOs7aTLp4hufXebFjgFAbztgxlDj+aNy FrSfUeayHSUyU96v9au41/xSmWwayx5WcB9b6SytQjcrKqNLzmSx2a5Vu1F0CuDb5YJk pNWw== X-Gm-Message-State: AOAM533xZZ0fCsRVw4cNIT/GnjPJznaNSRV4rF4uEg/ixD2vxqMUepR2 QlqZTFWRGTkSJzs0vBEVANuqPE28Lqo= X-Google-Smtp-Source: ABdhPJxwYivLFFFdkn2Ga8YCggj4QOHb4py9KF1XabTHt4gjbSGOXQHnxM0bXJuzhsWXIJh6hcz92w== X-Received: by 2002:a9d:63d0:: with SMTP id e16mr7069059otl.58.1643680659004; Mon, 31 Jan 2022 17:57:39 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id x1sm10811532oto.38.2022.01.31.17.57.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:57:38 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jan 2022 22:56:45 -0300 Message-Id: <20220201015648.2086-1-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avformat/demux: don't propagate unsupported skip samples packet side data values 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: Should fix ticket #9622 Signed-off-by: James Almer --- I'm not sure if this is ok or not. The AV_PKT_DATA_SKIP_SAMPLES doxy states the skip samples value is a little endian uint32 value, so even if the mov demuxer wrote a truncated int64_t value in sti->skip_samples (which, being an int, can be negative), it would still be "valid" when written into the packet as side data. Chromium's fix is https://chromium-review.googlesource.com/c/chromium/src/+/3424556 where you can see they have been reading the skip samples value from AV_PKT_DATA_SKIP_SAMPLES as an int. libavformat/demux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/demux.c b/libavformat/demux.c index f895f0ba85..09d539af68 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -1354,6 +1354,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) } if (sti->start_skip_samples && (pkt->pts == 0 || pkt->pts == RELATIVE_TS_BASE)) sti->skip_samples = sti->start_skip_samples; + sti->skip_samples = FFMAX(0, sti->skip_samples); if (sti->skip_samples || discard_padding) { uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10); if (p) { -- 2.34.1 _______________________________________________ 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".