From patchwork Sat Mar 9 11:46:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter F X-Patchwork-Id: 12272 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 30BB6444424 for ; Sat, 9 Mar 2019 13:46:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 123FF6883B6; Sat, 9 Mar 2019 13:46:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E5C78680813 for ; Sat, 9 Mar 2019 13:46:32 +0200 (EET) Received: by mail-io1-f42.google.com with SMTP id f6so82840iop.3 for ; Sat, 09 Mar 2019 03:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=VSWHusPpIeZhoDM5SDCKaK7DGqc+/iQmLdAirpIpjDk=; b=JxnIKUw6Vq3+Os+U6jZ6qoQMLXs9tKwiVXnMvh/b2So1DRTjh4u3uA937eTi5OmrNK Gf0Pp2ct2ZvqSRSVOkf3QPWA8Ewo1tWsJPlygIf34udaql1WM3lAsDsnJY2pi8ny+v65 tn02cd55y2DO6vdxw+lUgebrk2PnInjLI2jA9pP5LsCd5O0rZvNqJRVRHAVKWk2gULU4 lKO/FSTtOyFOAS/uOs5N0AOScgh9lWemnwYIaL4+mFmEJSsYglo73gudavS95QWoQERP gl7zAu2yNk8h2KNXhE+rxYKjME/ATFppIp9uK8UY2vbEI6Nx82I7/1VQjSMb5Ud2FAAf elZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VSWHusPpIeZhoDM5SDCKaK7DGqc+/iQmLdAirpIpjDk=; b=KE0i5lnoQseiHxvVg1HSx66yGHwaYhh2u7jCsLChroe2+BLJuUH8wj6+auVnvpUSam VDWk2LBxsB0gHM6tbXIPQSNWaCuVirdY9rPOHbo7mSb25h39yP1Mgqs9rLJCgU9st3DK qxyPXR8lIK2oDZyeNETkqA3mjdri3HND3DKbwMB8PLtZghH5h8yi7ZZNi58CY8ixHdkB 1bkTA6881LNAIjEYfigfyYysysaZSM/4fezN1khsK3b4j426o8Wila4hvdo527NyrNgH l7Xshtdxd/X+1uEHaBtLBqR77IRQIs5q8WKPgpxS7ZKgMEj9rvpnV/BdpeWxb+d4+AX+ aniw== X-Gm-Message-State: APjAAAUtUWtFbZovJ4GyP2zi1nsYzierJft+b2VQTncwVvggZA9hf1hx zfZZI5V/4/VQ0PsORycIl8ePAzwcie4ZvS/mUDDLs/7w X-Google-Smtp-Source: APXvYqy26177EvFdOii8K5Kt1/7BR5htksREVLwnmg8nHKOA3au9ll1W3qklC7copXkSdG0rVSOHuPq5PpuVtjw1FgU= X-Received: by 2002:a6b:7f05:: with SMTP id l5mr11570104ioq.224.1552131991081; Sat, 09 Mar 2019 03:46:31 -0800 (PST) MIME-Version: 1.0 From: Peter F Date: Sat, 9 Mar 2019 12:46:18 +0100 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] avcodec/vaapi_h264: skip decode if pic has no slices 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" Fixes / workarounds: https://bugs.freedesktop.org/show_bug.cgi?id=105368 [1]in ffmpeg This bug hits several AMD VAAPI users, especially those using h264 channels via DVB-X: https://github.com/xbmc/xbmc/issues/15704 Typical backtrace in ffmpeg code, which fits the description in [1]: #0 __memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:186 #1 0x00007ff39a9607b4 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so #2 0x00007ff39a6bf6a1 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so #3 0x00007ff3d1763820 in vaEndPicture () from /usr/lib/x86_64-linux-gnu/libva.so.2 #4 0x000055cd92b3655a in ff_vaapi_decode_issue () #5 0x000055cd926dc8e1 in ?? () #6 0x000055cd92a4975c in ff_h264_field_end () #7 0x000055cd92455ca1 in ?? () #8 0x000055cd923a3727 in ?? () #9 0x000055cd923a6448 in avcodec_send_packet () From 816e9156235a5d7d895b09c0235c9f8f1f7703e7 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 26 Jan 2019 19:48:35 +0100 Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices --- libavcodec/vaapi_h264.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 5854587a25..81a46fa747 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx) H264SliceContext *sl = &h->slice_ctx[0]; int ret; + if (pic->nb_slices == 0) { + ret = -1; + goto finish; + } + ret = ff_vaapi_decode_issue(avctx, pic); if (ret < 0) goto finish; -- 2.19.1