From patchwork Sat Oct 17 07:37:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23033 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 8F14744A23D for ; Sat, 17 Oct 2020 10:38:35 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6CD7168BA02; Sat, 17 Oct 2020 10:38:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B22E368B927 for ; Sat, 17 Oct 2020 10:38:25 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id h5so5909124wrv.7 for ; Sat, 17 Oct 2020 00:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CBFPw5cVHz4GEbjIHzvWOntmga/2k6nQD4VwkQUhfu0=; b=eMlRr+f0vBi/z7znd/aWVxIWvWHS8uwrN5JyCt+evHqdgqn8W0HIlcBR9+vv0sUTbo P10KR+3FyJgXRwgWAgRDrKAeIT7Ir29GsLeCj+mOlIRYsywZcBZYz6RkFTyxdpP+scts AwR3QPJ5+B+YjpZvPVUhFYydXlR6ZbkFvb+swbYlUnfqxBqHiiXiQs9H2t50Aumlw//8 k8UDRvOs4tV0aZ5ywOD59Pvsx7ti6QB+veHsy4NaRH60FzUWq+Df/zVEXiqwY70IGEn4 Xt38pKaGwSUBPK/ZQLEbodIXbV/odGDt9qxoNdc5cRVIavkDo06fMUix4VdKX4lbxPE6 xw2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CBFPw5cVHz4GEbjIHzvWOntmga/2k6nQD4VwkQUhfu0=; b=b9xl5k8HUT6XejD8wZQkuLXFVSQ8GexpK7ZFmggLTuwNcpfgSlERacUxAZwJqUJ6Sq TmJX4a83SO/pcYuq4b19eXYo5pbCio3d3DKmgK3SYU0bJjgijBH6hUf0SHykNU5hDWa3 uSOdrw1Bje/X1pfvGRjrUneKvFCDl4zTx/XHzEFLsErsh07QsOKzgEHBFbgPWxbcXWIG LxywNWfUtsgk7Sha3nrjDatGyP5egR8D3itKR1lTwag4VmDcyEJWxAIo3hMvXKIrfD+F WTYCmhGuLt8feC1KUkMr89b6vZZpBAqnzJZcq6Zd7sOpmF1iUyWQNg5PTGbDQaveAfIR UKoA== X-Gm-Message-State: AOAM533DCKSMR5rSmP32Q6HTEcdiEHdD05n4WjWmNAsATkZJDBV/5iGO UzVpWZo7l+WPGwLE+aKcbo3aQ1ARESs= X-Google-Smtp-Source: ABdhPJyAuYQOCEjZaVELbvmpqbl/Z8aJGB99RBlHvnQtIAM4Xdem9MzPGSOfYdaBnz7qcxA7DmNBSw== X-Received: by 2002:a5d:67c4:: with SMTP id n4mr760514wrw.125.1602920304792; Sat, 17 Oct 2020 00:38:24 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id 24sm5946553wmg.8.2020.10.17.00.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:38:24 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Oct 2020 09:37:42 +0200 Message-Id: <20201017073745.403153-5-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201017073745.403153-1-andreas.rheinhardt@gmail.com> References: <20201017073745.403153-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 5/8] avcodec/movtextenc: Fix undefined left shifts outside the range of int X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- Alternatively one could also change the types of the colors in ASSStyle (ass_split.h) to uint32_t. libavcodec/movtextenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 73d998d080..42fdf98042 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -45,7 +45,7 @@ #define DEFAULT_STYLE_COLOR 0xffffffff #define DEFAULT_STYLE_FLAG 0x00 -#define BGR_TO_RGB(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff)) +#define BGR_TO_RGB(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((uint32_t)(c) >> 16) & 0xff)) #define FONTSIZE_SCALE(s,fs) ((fs) * (s)->font_scale_factor + 0.5) #define av_bprint_append_any(buf, data, size) av_bprint_append_data(buf, ((const char*)data), size)