From patchwork Tue Sep 6 14:53:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Bouron X-Patchwork-Id: 451 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp626848vsd; Tue, 6 Sep 2016 07:53:35 -0700 (PDT) X-Received: by 10.194.110.42 with SMTP id hx10mr36913817wjb.116.1473173615060; Tue, 06 Sep 2016 07:53:35 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q9si30982027wjv.176.2016.09.06.07.53.34; Tue, 06 Sep 2016 07:53:35 -0700 (PDT) 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; 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 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 02B04689FDB; Tue, 6 Sep 2016 17:53:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E36EB689FAB for ; Tue, 6 Sep 2016 17:53:16 +0300 (EEST) Received: by mail-wm0-f67.google.com with SMTP id w12so9461383wmf.1 for ; Tue, 06 Sep 2016 07:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ZmbPIDLBZWsd818tCdqpi2CBZT9ibaU4HA6yHB0/xlc=; b=EpS8jAITLjIdN5Oy1ZbvMF+ZGnk6j1EXdB4AacCcfx8+BAd0zei/qBbNIL9/RgIPWK 0GGCqO+QrXARSVt1I7WLV6K8HazbCXAMhKZ374LcTmXtMgNCfc8d+V6EKlP/oPSrqrwF X8RJNsh6hTgDb0i4t9G3HBHRrpU66AG7VmB6XxhXs1CZrJ3Kr4f5q2a8BZfVB608aFq+ CIuu+uFnFB1YBSJ5Gf9k6DgEYnIYqFW+1EM05RZTuB4xZT3nbV5oIm64t5qzNHU4SaSu nS7KBasgYTuIzS8zV8Hk/RFa5N0PpS6XPJlq57sXSQm764FwMFvNzln8lHfhQhCVzGvM z9hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZmbPIDLBZWsd818tCdqpi2CBZT9ibaU4HA6yHB0/xlc=; b=hJ2rsz8AdbKjjRkQ4kdG9FsA9aGP0Q6y99N4haDwdmv5NKi55s2+bV2eIYTiOpBrvZ H0e6zvkTMdqnLUE6y49vvXbh0GzHD7Im4yNnP0JE+UQGpCTfWh9OXWLA/zSku3RWeHYm vCWmipBggmh4wmvfs+N6+qIImkWtd1glFZutPGBMrfo94luUhZ9vXYGG4M+SHf1487Mb zJ+VDYIJoTqX3jnK43vzL8RK6PbMQj/VeqbB+CkAeSb3TQVqnL67fwpUnBfB3wU8naO0 2X1bZVix2WtcExk4aXBNBW0yAYWMcbyq1pRHsXym+iWRlX/48vQ52AHJ4mBUP+aN5LWO xWEg== X-Gm-Message-State: AE9vXwOyYfkK9DS0CrZintdNXIpG/WX4MW9VRuK+BJ9G+OwIv3odoCCA0JQtV5sZ0QmOCA== X-Received: by 10.28.214.130 with SMTP id n124mr20193001wmg.37.1473173605665; Tue, 06 Sep 2016 07:53:25 -0700 (PDT) Received: from obiwan.gopro.lcl (LPuteaux-656-1-74-135.w80-12.abo.wanadoo.fr. [80.12.80.135]) by smtp.gmail.com with ESMTPSA id v2sm6813257wmf.3.2016.09.06.07.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Sep 2016 07:53:23 -0700 (PDT) From: Matthieu Bouron To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Sep 2016 16:53:17 +0200 Message-Id: <20160906145317.19106-1-matthieu.bouron@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH] lavc/mediacodecdec_h264: fix SODB escaping 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: Matthieu Bouron MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Matthieu Bouron Fixes escaping of consecutive 0x00, 0x00, 0x0{0-3} sequences. --- libavcodec/mediacodecdec_h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mediacodecdec_h264.c b/libavcodec/mediacodecdec_h264.c index a141174..4f9d737 100644 --- a/libavcodec/mediacodecdec_h264.c +++ b/libavcodec/mediacodecdec_h264.c @@ -104,9 +104,9 @@ static int h264_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, int } *out = p = new; - i = i + 3; - memmove(p + i, p + i - 1, *out_size - i); - p[i - 1] = 0x03; + i = i + 2; + memmove(p + i + 1, p + i, *out_size - (i + 1)); + p[i] = 0x03; } } done: