From patchwork Fri Mar 15 00:23:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 12313 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 9E40D448E29 for ; Fri, 15 Mar 2019 02:23:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7686B68A66E; Fri, 15 Mar 2019 02:23:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB00D6800B4 for ; Fri, 15 Mar 2019 02:23:47 +0200 (EET) Received: by mail-it1-f194.google.com with SMTP id 188so8196384itb.0 for ; Thu, 14 Mar 2019 17:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=cDD1sqRPqeJkojv4HXLXUeKBhJxJf95ruxkawExoBJc=; b=nDW8OdB4jmdTj7gQYYiDgIQm97eIgvqDoYWguIoD2XX5w3R5RXmbNpIqpTmO5Acy3A u5ZaG8z62s3vsEVZSvy8laCSPhuQVItHmCwwiVMshSj1zVzSY9iYQeRVwQbaZKnm3A1W LoOsBr9Aq7G9BXE/CYa8ZS/xAiJUHP4dYpnIuw21EpZ0hFAuctGJrXnDv9seMVjYwQoF xsw9hB+LFELwdA4yhse3acMLfdvJ3J+aSn9f2Tp6GV6gCWADxmxgTQAUiRh95b+gDaj2 GYDLatxy7IPf0nhO8J9bLiQo97QUEhVJfnlacJbFjzf5gV9fBivMUnkD8YheYmrxYeH/ hJwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=cDD1sqRPqeJkojv4HXLXUeKBhJxJf95ruxkawExoBJc=; b=TjZfa0ZA5WOwUEOEG/WO7toGGqjmj0LFtsDQX6rf8qy+ednvCkhibIOABkgJ7Au202 dlDXvIi13AR03/xvvjyPEfNo2IZ8z94FAz2W1vFcBCjokkvwxEfrSZYiWXICQaifcMy4 sbsrgzN5cVA7RST1gmRxBLbB2HfctTV4lQbSJT2a+Bbj+ODrgjjNTc1iOjUAbb68ZdRl WQNABQadUw/0bkC4Qu04HOOc/o0PTK9fkWmA1wAZ4QcUYe70UJDC5iOtd+pFhKu3XsTD YilgLw3cS56hCNuU7sHX99crwKyisYULUFAkNnR28q6OT3YjJ/oL4wcPiANA+IH/BId9 z4UA== X-Gm-Message-State: APjAAAXwllfD3ctkorNe1Coq4tetYcM/ozuBwFn52MQ3DmvaS8Vv5DAS DgLwkTLN53XkTwUqwMioxcNFVZpeZzspnt6haZNOmA== X-Google-Smtp-Source: APXvYqxPvcv8moXXgnEeHrETGzXy6LiHHv5bAk/RBLGJYD0rZM/dlDjww2I8LlQAhuSJhP9QN3pVm+lc22KPujAiWAQ= X-Received: by 2002:a24:bdcc:: with SMTP id x195mr256964ite.149.1552609426603; Thu, 14 Mar 2019 17:23:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:fca:0:0:0:0:0 with HTTP; Thu, 14 Mar 2019 17:23:45 -0700 (PDT) In-Reply-To: References: From: Carl Eugen Hoyos Date: Fri, 15 Mar 2019 01:23:45 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH]lavc/qtrle: Do not use aligned writes for odd addresses. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 2019-03-15 0:41 GMT+01:00, Hendrik Leppkes : > On Fri, Mar 15, 2019 at 12:26 AM Carl Eugen Hoyos > wrote: >> >> 2019-03-15 0:13 GMT+01:00, Hendrik Leppkes : >> > On Fri, Mar 15, 2019 at 12:05 AM Carl Eugen Hoyos >> > wrote: >> >> >> >> Hi! >> >> >> >> Attached patch fixes the qtrle crash on sparc for me. >> >> >> > >> > It should be fine in cases where the pointer is being incremented by >> > an aligned amount, ie. writing 32 and incrementing by 4, or 64 and 8, >> > etc. >> >> Of course, thank you for the review! >> New patch attached. >> > > LGTM if tested. I pushed the patch that fixed the crash on 32bit sparc which I had tested first. Attached patch fixes another fate crash on 64bit sparc, I don't know if the change is sufficient for all use cases, it passes fate. The crash happens with pixel_ptr = 2852, rgb is 16-byte aligned. Please comment, Carl Eugen From a7f5fe1d72aef47e46505f94ad247af5486b43de Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Fri, 15 Mar 2019 01:14:58 +0100 Subject: [PATCH] lavc/qtrle: Do not use aligned 64bit write. Fixes a crash on sparc64. --- libavcodec/qtrle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index 1cb3eb0..1613530 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -388,7 +388,7 @@ static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change /* copy pixels directly to output */ rle_code_half = rle_code / 2; while (rle_code_half--) { /* copy 2 argb raw value at the same time */ - AV_WN64A(rgb + pixel_ptr, bytestream2_get_ne64(&s->g)); + AV_WN64(rgb + pixel_ptr, bytestream2_get_ne64(&s->g)); pixel_ptr += 8; } -- 1.7.10.4