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 E213844728 for ; Thu, 24 Nov 2022 23:00:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C59568B91B; Fri, 25 Nov 2022 01:00:39 +0200 (EET) Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1091F6899CC for ; Fri, 25 Nov 2022 01:00:33 +0200 (EET) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-1432a5f6468so3304961fac.12 for ; Thu, 24 Nov 2022 15:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ibp5LGFdcUVg0nQgp9bA/4lFRoxpIBDvrS/W9+GOP/8=; b=nz61xlFPnNYtoysK5XZe3+5vXl+QRNNEFI/dW9+faV7AN9GbGoEsH27uh6O2tIOjgk ZuiU+mvclVFJs8JcryHWJCwwzUevpJMQqA4E/JYFHEbxEYKYee+G+cEbfYhDpTaIRzIt iG3ORwmS4pJMuT2bY1iU/yITUpN5YkWytIm0cjb4W2hZe5Akgyns1qTyWh6NV9+r6+eR HTOYrP5qc5fcUGKGDuci2torB+em+lSlSU5IaaZOp8e5UnVCZ0IP3MR0dhS8B/6e8TlX EXfIOAI+mutV96M3qOFsuNBx/OAHFVDf61ZESFP39iWmUAUvTJpOGsZj6hM9rs+d2Jp6 zhCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ibp5LGFdcUVg0nQgp9bA/4lFRoxpIBDvrS/W9+GOP/8=; b=yVtM0paSrIT/jQjXwqBoF2S8Ur5yjUx9Qx7zlleRTqTGtno76nCltHXXJPRc75+WoH Ma32hlR3hJ88OEGEvZJXa9goPbzWSO2S0mjPAhxfF57qT/5reHvi+fdVn6D5SVSIlRMW wfF4DtLTD/7KfyU3af5bunlC7g6ceewgIAOzM8GF7fg4sqnfwMTCZ3pUp2rlvlNqVysX eQxpc98loziBzP8VrAm1+JpvEWOeIgkO4T23ak6e4m5fhhA54hRsfI27Nkg5Lr9TsMnT 0yXqzaecnkjONB5M0OVvZF2oZ5L+5oak0SHJDUZxGK0zlwWhFJknzlyN69wBTm5gL/G1 jSbA== X-Gm-Message-State: ANoB5pl6Yr0FGaV0+dOX7WQq9KmovjrTo3AA/3oHuXduVGmDpso0v7nY YkElgxRPG4j3If3h34LGGw2dPi4jbs8= X-Google-Smtp-Source: AA0mqf7GoB/i7qriBonCKIVDudYo+LGdhhqvey/CV9OKKPtigYOwTT2zhsxrwFOeACrncLe5T5q8vA== X-Received: by 2002:a05:6870:4e0d:b0:13b:470:6108 with SMTP id pl13-20020a0568704e0d00b0013b04706108mr12805433oab.168.1669330831046; Thu, 24 Nov 2022 15:00:31 -0800 (PST) Received: from localhost.localdomain ([181.85.72.69]) by smtp.gmail.com with ESMTPSA id l9-20020a9d7a89000000b00667d9a866b0sm893154otn.59.2022.11.24.15.00.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 15:00:30 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Nov 2022 20:00:51 -0300 Message-Id: <20221124230051.2874-1-jamrial@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mjpegenc: take into account component count when writing the SOF header size 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: Fixes ticket #10069 Signed-off-by: James Almer --- libavcodec/mjpegenc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index 6dfc4469a5..049ae3d929 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -308,7 +308,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb, default: av_assert0(0); } - put_bits(pb, 16, 17); + put_bits(pb, 16, 8 + 3 * components); if (lossless && ( avctx->pix_fmt == AV_PIX_FMT_BGR0 || avctx->pix_fmt == AV_PIX_FMT_BGRA || avctx->pix_fmt == AV_PIX_FMT_BGR24)) -- 2.38.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".