From patchwork Tue Feb 1 01:56:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33964 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp217940iov; Mon, 31 Jan 2022 17:57:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbuCdr1w0hIuoRE3ouX+7ia5effNn1Pmi0Z6fpkYTGaODScan+84L4pXknjvXG+Pat2fPV X-Received: by 2002:a17:907:d0d:: with SMTP id gn13mr19474164ejc.266.1643680673053; Mon, 31 Jan 2022 17:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643680673; cv=none; d=google.com; s=arc-20160816; b=xtvexR87YUiNgmrelAMR5dyvQ8y7s2qjGCTuJTO9Olu2tJV7Y1BSXsCI03esSxkw4H 097B7VFFiXQbeYGVgeF0pIMUM0ABfTIynQbLDyHX71xOpjhTcUfEDl2f4J4EzOTf2Eq5 C8V9wpFpZIKLk3lCUWvCbiX5REr7TXVLpCnSe9cdK4fQ0a8GtvQDI0aXr23BdSW7CNi5 PH4uYDxJYwvTIUAyU72Gy5H/0SlOSs7q6zroa6H3iIYZbJBDw3xKGhZEEtcHHr/9MmsP CsIEqiIq6ieprMmh783uVKwHEb3S84dkXzxRW13PHYCkUJ0sWjS3SAR2SoM5IWNRSdEB wefw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=bGTAX3a0OxZLDI3Z+moQPGQAgdS7GC+Dw2CEz7b1TmQ=; b=T1Jkw3VjG7IcT4I9clAClc/Kd7oBOb1kVeuX/Jnakq16AGYxNmJDDeuB79x3dFqDyR cvzwDn9IoZXYj4UiJl/t+95jL7KDDYY8ULihktlb7R4QUJe8zsECoB3piNBo/2fEpj1h Al6W/8OgrIQ6gIxY9WkFDBvceWfFnt5jlblwMkMiPteS4/0c+VWNADEOo1aI2lzcZ6Ml hjrJ7GtRTZ7RgTcsZMDlQIPmzlajUvAYbsjxZ7s1qhX4Z8jZ03D/rO4inIfQ/q2EAVWE paOycuMByMLBLSR0hj12O2K/8YWBIp5S+8M/g7zT4WPVbv3CSAHImrTyZZkT7RbbISup 3a3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=FYE8bLXr; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n13si8577285edx.501.2022.01.31.17.57.52; Mon, 31 Jan 2022 17:57: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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=FYE8bLXr; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 09E3768B169; Tue, 1 Feb 2022 03:57:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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-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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: L3+iaiCvbcxS 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) { From patchwork Tue Feb 1 01:56:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33965 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp217991iov; Mon, 31 Jan 2022 17:58:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1mfQigh9SOla/9f17hAN0v2jHVIcjN3hgFT5VCQKREO4rsMTgM5kyHkuqh/IHljHv5mW6 X-Received: by 2002:a17:907:2ce4:: with SMTP id hz4mr18286708ejc.613.1643680682099; Mon, 31 Jan 2022 17:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643680682; cv=none; d=google.com; s=arc-20160816; b=gJWSJFMHjR+a91jCFKKMA1NThVi3zpkNgpHItN20Zzbtp2db8exLL4Hghh7Pl9tgPg o/DIMwskDSoKxLR5C6rZ9vwRar3J9bedm1/dGqSTs+br0gTRp7GoMnS8J8D08ENt493h 6JOJGx5yXQs6UTe+gHh39ImOjyE5QAbfseL2/+kabIigG1aqJUDFwSd3vJ77jEvJwTyv dI0oxfPO5gE7qzmS8yqkHmtu1Kayqp+fXkGTywM0riG6gmAs8ptkt/EUZQF4JAMI5h1B QZpNqgY9kPjqHkCnPRtMaxGP/u43x+9AYZTYjGDmptVVHOyVXr7z+d2uPnMKvHXckku2 YbyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=6En3kkaPmBgHY3Fwq+dmFCEXBfLOMo8hrx5qqFa6/UA=; b=gPxNG5WwVm5ah70HZVluVHF71hGuC9x4ImiWzMxFJfYUt8gpr2pUxqSc83jJbbDF5Z nnzcZhl+1F4cruiuFC0UPcOdDqxOAEFXCjMYNsrPv056cr8kOO9R5M2DxxP0dejCHM3c dvQhx2Wjlc82wOY7dWugXewokxJtGpX/1BuubRJR7dSqzzrGemXUHreqqIcyNdO4nL3Q fTxOsyQySP4JpE681i69y/ObnIjX1YpzWelmDIX36quFv068EVLq4JxAMTa0QU+gNvxJ rX56Mf0pupGLvVinAtxU6Ld1F9uH3DAr9K5+sZbr7dLUlyAfNZqqYOL3FrWoyYreC1Xj GjzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ozvkQofY; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l9si7422867eds.288.2022.01.31.17.58.01; Mon, 31 Jan 2022 17:58:02 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ozvkQofY; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0854168B19A; Tue, 1 Feb 2022 03:57:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 C8A6768AFC9 for ; Tue, 1 Feb 2022 03:57:41 +0200 (EET) Received: by mail-ot1-f42.google.com with SMTP id i16-20020a056830011000b005a3cc8d20fbso8420330otp.9 for ; Mon, 31 Jan 2022 17:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=nhcDujgBrFv68GjpKjkxlN4ECA0MK/dazOBMBP+rv7s=; b=ozvkQofYwvDqjfUHiDV1mksITwezonDcHFJ/jdhR/QMVAhvDuPyaBOZHcPUZ4ioPMy Dc71EjD+w3IqmouFdCcQxjuGt/zTNjZj1PzcDeLLaH5a3den37cGNUAJ4qimkepdM8lZ kXJcsC9M0H48y/O1t7HM6SeqPlbmD/md8C+Ul3JfbarDvGi1nIdNMpcBrIIimuZXgMRK XJhxu2CVUbHoc+5hR8EUCbdlWLBEqi6Ik2y6UzmJjAOxxznZ8KwJHFkntoyUYhuJ6viG MLLfHs/jq1ky5qAObuX8dkQaUp3PcXnnwLTDv7VC36IH4rnotsqmpgipXEIuEQAfszUB 5eEA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=nhcDujgBrFv68GjpKjkxlN4ECA0MK/dazOBMBP+rv7s=; b=kbc2C/UrBC2wSt6siCVcDqlEY5Jv3SkoDHJQwM32rblnN+75tRfgEE5WU7IlDPhwMg yluazkCZl6IGybqKTPt5rM349/MCq7i/LMV260a6UXmvkSV+UbKMF3ToS+PRz/kvjjDz B11umEzkJC2VdqDlQRcJBcNN84zVAjpPIXNBCsLYYbX2j08q8dWYvHKz0LrjjHwco/ee czttdRDEWCobSnk2YfuLT7Ol8qcxga+/Wd4uURoyHktPxWeZtTkara+J6hq77la852w+ v90e8yUf4ycKcHsc6858qvaz1Q5/jSpU03t/WKXxYUM84h4zHVObTa7Kvt3BjY7rGPQ7 Yv5g== X-Gm-Message-State: AOAM532G2JebU513DqvDQZWON7Ik/Z9G6Vcx3wNO50yIp2H3lVMU5lQL hdP6CRuL3SfEnPkXZC2DCQTOXQbAUwQ= X-Received: by 2002:a05:6830:1b62:: with SMTP id d2mr1890881ote.66.1643680660334; Mon, 31 Jan 2022 17:57:40 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id x1sm10811532oto.38.2022.01.31.17.57.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:57:39 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jan 2022 22:56:46 -0300 Message-Id: <20220201015648.2086-2-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220201015648.2086-1-jamrial@gmail.com> References: <20220201015648.2086-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/decode: ignore 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Rktp5Pos4eyh Same as in the AV_FRAME_FLAG_DISCARD codepath, ensure avci->skip_samples is not negative. Signed-off-by: James Almer --- libavcodec/decode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 0912f86a14..4f9b949926 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -366,6 +366,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, side= av_packet_get_side_data(avci->last_pkt_props, AV_PKT_DATA_SKIP_SAMPLES, &side_size); if(side && side_size>=10) { avci->skip_samples = AV_RL32(side) * avci->skip_samples_multiplier; + avci->skip_samples = FFMAX(0, avci->skip_samples); discard_padding = AV_RL32(side + 4); av_log(avctx, AV_LOG_DEBUG, "skip %d / discard %d samples due to side data\n", avci->skip_samples, (int)discard_padding); From patchwork Tue Feb 1 01:56:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33966 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp218039iov; Mon, 31 Jan 2022 17:58:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIda1cAF9UIjKt/SZGsyiPsGb/7uykd85x+fUVmjugJTmIrT04qtyMoYTliDlhiOJ03dPR X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr23042094eda.162.1643680690691; Mon, 31 Jan 2022 17:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643680690; cv=none; d=google.com; s=arc-20160816; b=FckJvymxe2JJF9uo3TXBr3x5vpbEF87j5YolEnNxGvsTWnRfg63k95w1aElMG1jmq/ E8fC5Hs/KJxl3k1zmee5Xdi0KNg38QOBX6KrcTRjh1WEjMINcf8hzy1vYFCIF/dACVca E0rs7z+cyTeu8Xx54t634G2cB2msMjeEyWpX4avPhVZgbdKap3h5OsnsB83MHmmLJcxC GXeLiSs3Lay4qbpH8Y0LA689AeKZ/AiCKYpVR6omStoriX4vcpsY+I7dTazYwTm3MuQr qKvbuh1Ft45eRMRVuwJqlQpBFCnXyeghf9ZJ1Yq1qdkjnWQXFOrXigl6VVjOJnYgKb9u rWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=3Z5aUnLjU3aYs8mEfxIOyvKWnvaMR9HIvZzuHabmmwM=; b=nDhpEl0kJh8Qp2eTOANbrM6+KSaOGw4W9pHPC01vWCGK3+i06PcwrFLjP4pt/XW+qp B9I0khKGYl7e2bvdBbfL2OXtvAHDSLJ9HYxAMurB/l1o2MyXyFYjm+Ah3jTpgyh6QZS5 mW2SUHHXelaj6w6FYUBRwhpvviOZcMAgoi9gDprEJJ74+nGhqas3r5VIM0AtEvCMobMB Sr/iFqgIHP3h2myR640AuSwP13UY504g0+Y7jRIe9j3HhjD37VMqJeaWByo92LtD14Tz zBI2M2HLAxv1ga4/RJWlVQ8HZGp5kW4Hq4/PNfZzwqCWurCEpdRhoj75U45/aE3g24wZ PFrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=kAem3pbu; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i42si9000791eda.537.2022.01.31.17.58.10; Mon, 31 Jan 2022 17:58:10 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=kAem3pbu; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14F5A68B1B5; Tue, 1 Feb 2022 03:57:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 4A7BC68AFC9 for ; Tue, 1 Feb 2022 03:57:43 +0200 (EET) Received: by mail-ot1-f42.google.com with SMTP id e21-20020a9d0195000000b005a3cd7c1e09so8085554ote.6 for ; Mon, 31 Jan 2022 17:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MYS7uAzGsO/o96CeTtpzaN08cM1qfrNo4iEZLmplT2c=; b=kAem3pbuAbYJ5gb5y1Q7V3ly/cJNQx4GE1nV+fHcmwNDMI1VLj4jKf+eHYNFILOxv+ V0RuNysXPPtUWVPQybn/j4rWbQTA96q3uMzEERuWHT1O2g40aYMG31NdIw1LWtetJ3wt dQNonduwaI0J+Av3aNAQiTvNt/ch1Xs1Jy5eT8zmyFdUQnjDQbSsICKLlnTYWiMIf/7g uACcpWmuNC75SiOPWSPgUF4hcR5i6PEe0vsciA5gSfcDkX4ffq8CzPeAfi5B9NG6uEcj aORj4Ke/7XPGY1Zkk8iPFjDrcbYipYuefv07UFHGC+ILbUNzvgprVNbAcZQKL6VsX4eP fU9w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=MYS7uAzGsO/o96CeTtpzaN08cM1qfrNo4iEZLmplT2c=; b=wZtgriW1wcid8/Hr9m0KG7HkpNWO3ZX6+g9VwAcqrN5nKBNAPMQAzqr2aTgI5XaaCW lo2jcIjpgQMYuvhDhTDQ87fyyAEFA8I7aHKl+bIo1D+bUGqYbzNouQYLR3VGjADu/RE4 xSaLohIumMaW+6CAwE9Urodh1e/t85kBXS+KE51rrZisXtwcxRTQuPnfP+uk3j8V80E6 m544VxKa8M5DV8rwkJDwLT0q4Cf4WWa8K7ONnBVKCpqbNT+NAGnI/RaxEcd2Zm4suJ2T tae7B+tN8r8hgZIkkfkX/65e34Bvmp+kvipTNCTwKMU98RIuoiAYNNAyJgN2Eun5ZyJB tRgA== X-Gm-Message-State: AOAM530701gabbUwMTvjwruir/UEnk9p+loKki0Hcw/qs9/wjM0rUIqz DYwla6CDXV2IcsXxDnBpDmwUMGRIz0I= X-Received: by 2002:a9d:7518:: with SMTP id r24mr13395146otk.97.1643680661783; Mon, 31 Jan 2022 17:57:41 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id x1sm10811532oto.38.2022.01.31.17.57.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:57:41 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jan 2022 22:56:47 -0300 Message-Id: <20220201015648.2086-3-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220201015648.2086-1-jamrial@gmail.com> References: <20220201015648.2086-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] avformat/demux: print skip_samples and discard_padding as unsigned values in debug log 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Cv1elrn08HL0 It's the type they should be interpreted as in the AV_PKT_DATA_SKIP_SAMPLES side data. Signed-off-by: James Almer --- libavformat/demux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index 09d539af68..4509015847 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -1360,7 +1360,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) if (p) { AV_WL32(p, sti->skip_samples); AV_WL32(p + 4, discard_padding); - av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d / discard %d\n", sti->skip_samples, discard_padding); + av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %u / discard %u\n", + (unsigned)sti->skip_samples, (unsigned)discard_padding); } sti->skip_samples = 0; } From patchwork Tue Feb 1 01:56:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33967 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp218103iov; Mon, 31 Jan 2022 17:58:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxRQGvp8Kz1vP+zIAhW6LxI7e30tkJ9uJMw2yFCTvGxOTpRuhQZZSxk81fKTZHpqmfG09z X-Received: by 2002:a50:fb8d:: with SMTP id e13mr1047902edq.334.1643680699665; Mon, 31 Jan 2022 17:58:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643680699; cv=none; d=google.com; s=arc-20160816; b=TbfH0WPsMwgms229bqHg17jfRnQf1J/5S/XCcqKurAwlMXPpqpSWHaz/UOdFqmlDo0 Ggp4FLJpQjyvJkehoOw5yJ5n1Jv8jqadU7wlxSVbKRiGwuk1wF6GOxS1Djkep8buqNVT 50inF0hhehWyryU+toLJPypdW9gguU8vUxvwDwBsTrhiI9MDlbeaEJXIm1WT1AsriID4 +D8nrL1kUfEiMRT5kT0Bg/OZOrXUtwsSxDw9od8tYlnYx3RQXARPeZbnDpVXLBdon6Hs vuPuW9kGjDIXHiyrfd1v0iU4MFQ5oR/XETAdjxu+LBiP3NPR5GBtQk3m3AtqOZsp0ty2 c+QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=gJU08iefzlLo4wjf70pLOqwShxJD37iM1RqZLLsEASQ=; b=BFunhsLXsZ9XPyB+36traCktGldVoofBNESChmy2Gh88hAZEXEeXx1rSBIoVp/tU1I 5bgPRdqQhwUdj+EFgG3L1M67P+IeOUoJ/aHjKIQM0TwwqWL5ha3xjMG4BI6XpBytiHFC mHEgbfqgwHrRYhnUX2gZFwJPhcqONOF3n6QCRcnANY9p+tqYo08BV1pDcEgr+UNZOuWo jrCZPvvWp8VG0Y9HKBgaa/yAG7qzoIcUSbNGbAko2KC2zUz8iPOq43Wy7387+0SueWZe Ni/Bk38VvAj43i2uEWl9XC0DdMbtV2hwESo3uR/K2xu5xs6QwZHNC9syoWF6mizCoYfP +OjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=kLdxeU6T; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q6si8378692eds.366.2022.01.31.17.58.19; Mon, 31 Jan 2022 17:58:19 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=kLdxeU6T; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 203DF68B212; Tue, 1 Feb 2022 03:57:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BDC3268B1B5 for ; Tue, 1 Feb 2022 03:57:44 +0200 (EET) Received: by mail-ot1-f43.google.com with SMTP id e21-20020a9d0195000000b005a3cd7c1e09so8085591ote.6 for ; Mon, 31 Jan 2022 17:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6ne16MURgLdrH3v9jmUEoRYP08GoLIOSC5nvydIHQ9o=; b=kLdxeU6TGt2xqHgsNLQXLEZAy0EhXpJMdRwWcL88L38ZvlayCZb43SGho2yp5932hv B5F5ap9+FPooCGtW8l55Keeydav8wIakrGatpV0QrTz0oEYt6FKjpuhEFYOn3vLOXQgF Zvue8SUDGme0wKtRYvLbgV16IW9W/k9U2E/c4Aj+a/l7xlA648lpuDOePf/LoNPF60t/ VZNcQ+WpDuDN3S35knDoZKs9Fa9Xr1gwCsB6WC0uFjwuTkPfspOLxs6DjMyYlK5BFfJ3 4fvlimQqtK/T8NCjVKWRj1VbO1d7yIvyygmOh+qo2Aoutoh3UCR03283de3i+JHHvtYJ ctYg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6ne16MURgLdrH3v9jmUEoRYP08GoLIOSC5nvydIHQ9o=; b=IlGcmNOfJ0ItYgX7VQC5ft6twTEJG6sFzJE+c1MvtbzoaTSQv3hDFjfLrnhJrx5LRu uQ9NX0udzhCxjdk0DVBgobS11seELvsmV3Go0cwarU2PQXNa8aV0mOsVmfI28r0twtB6 XP/8BOhoOMvsPezxovnDxn3+raT74ZGEnaZiG5NRUDW2iMiwexxQ2mvqtaa2QZFdEhXW fII9V21r8w9SJgLdMW7Hr2eVY8OKDVEAplGZpAKHtk/dsjmzn5AIP0Qt0bIidrMTdZcF BVp+/9oN9BbhsKB5b225g7kVF/BH2LaQd75AOT7va8QAH+G4ofeobcc6Hw55JTp5Bc9o gIlA== X-Gm-Message-State: AOAM532uL0XfD0FhYrnLVL48vIXIdILmRzOSdRIQa3saB8WP/UFvvhoI +EVJSzHiDHbzU+NUfBqvwgUGi16nznw= X-Received: by 2002:a9d:6d01:: with SMTP id o1mr10208055otp.204.1643680663122; Mon, 31 Jan 2022 17:57:43 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id x1sm10811532oto.38.2022.01.31.17.57.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:57:42 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jan 2022 22:56:48 -0300 Message-Id: <20220201015648.2086-4-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220201015648.2086-1-jamrial@gmail.com> References: <20220201015648.2086-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] avformat/demux: don't truncate the return value of ts_to_samples() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2Gt0oPmc/tDm Signed-off-by: James Almer --- libavformat/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index 4509015847..ec34b65288 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -1346,7 +1346,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) if (sti->first_discard_sample && pkt->pts != AV_NOPTS_VALUE) { int64_t pts = pkt->pts - (is_relative(pkt->pts) ? RELATIVE_TS_BASE : 0); int64_t sample = ts_to_samples(st, pts); - int duration = ts_to_samples(st, pkt->duration); + int64_t duration = ts_to_samples(st, pkt->duration); int64_t end_sample = sample + duration; if (duration > 0 && end_sample >= sti->first_discard_sample && sample < sti->last_discard_sample)