From patchwork Thu Sep 19 22:16:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15165 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 1F7C5448C54 for ; Fri, 20 Sep 2019 01:32:27 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0B44C689EA5; Fri, 20 Sep 2019 01:32:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A579D689E5B for ; Fri, 20 Sep 2019 01:32:20 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id r5so4715175wrm.12 for ; Thu, 19 Sep 2019 15:32:20 -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=+I9oGCSblzxo/trWLb8E3eyjF9G7i4LNIfPBMXUs6D4=; b=HQ/vPzM0L+YZyA4YMpMBVCkL33GpqpiQGoPTENlmLSryAFhH1kYM8mQIi94YFhniuX lclj49mi4KI/hhnc1XnLhjywaUlxrYoU3ENxu2LE2L4Pupgzq9gt3ZNIiW324ksV6y6R uXXir2io93FofTVJPuujLlSr0hwTcee2VuDwZMaWkeFaUTIGHBuKy1v0sp1jTzIs5s3M peEbuHdxIwH13HC1riJlaLEu4OhIpwfbJw5Y+A9SIqkwC5kJ1ugKc5G9hcT08RqudhXe WKT4X+Xp8iG4mlv/BW01s6bWrijruaTCyIsquN1Df4h5YXTMI/Pv0m2BZ1qkRgd9zLP0 ooxw== 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=+I9oGCSblzxo/trWLb8E3eyjF9G7i4LNIfPBMXUs6D4=; b=uABaUXAUCgAZI6WMr0iTBOOS0vRf1+nYA4pkAMjsRjGA1CfQuKkqW84f+K+FXORISm BksKXF2JXQnZ4dIDOj4QS1J8w9LFhfiGIOXDRL3ob912rSvfHIwAOi6Y8yD/H+lgYbI/ uegjd5Gm2NAB9Pr/9njBlwzyh9SzlHmUgfAaWTf5nal4M5NdY5d+L8cIYUy0nHb9qS7f fmzr5H3s3BtgPBd/JDyi0qP2ycJLzi7dfcp6da0WQk3q/TDsIV/tiyVdLRxG+5wxnCJ8 ope2jZMjKNQ6coUdjgfpjJGK6bUBcbQvTiDXrTjnG2XfX2ljrZDECAQQTcH24G9g+NtU 5Lwg== X-Gm-Message-State: APjAAAVEoEVQRtmgB48Fra4qj9+3ChkhOS1W7sDmjGgaczadWEWavjII unsE1VA/4rCsOHYCD4b1Ezus8jh8 X-Google-Smtp-Source: APXvYqw04N8PnxsC4M7hhC8DSaBRC3Znxq8nFXh7JoA5XHCXwUWh1OxNWCsgZzWzG7KQe77jcT7yYQ== X-Received: by 2002:adf:db06:: with SMTP id s6mr6051499wri.41.1568931867708; Thu, 19 Sep 2019 15:24:27 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc0f857.dynamic.kabel-deutschland.de. [188.192.248.87]) by smtp.gmail.com with ESMTPSA id y12sm49955wrn.74.2019.09.19.15.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 15:24:27 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Sep 2019 00:16:59 +0200 Message-Id: <20190919221706.16529-5-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190919221706.16529-1-andreas.rheinhardt@gmail.com> References: <20190919221706.16529-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/11] avcodec/tdsc: Fix undefined shifts 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" Fixes the tdsc FATE-test. Signed-off-by: Andreas Rheinhardt --- libavcodec/tdsc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c index 4182404cf0..e9ea41ef55 100644 --- a/libavcodec/tdsc.c +++ b/libavcodec/tdsc.c @@ -187,7 +187,7 @@ static void tdsc_paint_cursor(AVCodecContext *avctx, uint8_t *dst, int stride) static int tdsc_load_cursor(AVCodecContext *avctx) { TDSCContext *ctx = avctx->priv_data; - int i, j, k, ret, bits, cursor_fmt; + int i, j, k, ret, cursor_fmt; uint8_t *dst; ctx->cursor_hot_x = bytestream2_get_le16(&ctx->gbc); @@ -231,7 +231,7 @@ static int tdsc_load_cursor(AVCodecContext *avctx) case CUR_FMT_MONO: for (j = 0; j < ctx->cursor_h; j++) { for (i = 0; i < ctx->cursor_w; i += 32) { - bits = bytestream2_get_be32(&ctx->gbc); + uint32_t bits = bytestream2_get_be32(&ctx->gbc); for (k = 0; k < 32; k++) { dst[0] = !!(bits & 0x80000000); dst += 4; @@ -244,7 +244,7 @@ static int tdsc_load_cursor(AVCodecContext *avctx) dst = ctx->cursor; for (j = 0; j < ctx->cursor_h; j++) { for (i = 0; i < ctx->cursor_w; i += 32) { - bits = bytestream2_get_be32(&ctx->gbc); + uint32_t bits = bytestream2_get_be32(&ctx->gbc); for (k = 0; k < 32; k++) { int mask_bit = !!(bits & 0x80000000); switch (dst[0] * 2 + mask_bit) {