From patchwork Sun Aug 19 10:01:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10026 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp1341047jap; Sun, 19 Aug 2018 03:01:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwLbyvNiA4bXephRXE7KCR8pvaldBrV4rFY8iRwFQ5OtYqzk/6F89rZnmpMkILeDuYRm1zu X-Received: by 2002:adf:d4c4:: with SMTP id w4-v6mr26082557wrk.185.1534672895571; Sun, 19 Aug 2018 03:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534672895; cv=none; d=google.com; s=arc-20160816; b=ysuiIKKgPo9XMIBL1tOikiyVeSbBs+VjKXIaZ94gFus/i8YI1poo+B0Vw6yoZlArI8 k/jF6laDtTmSFxPKnKT8Di1JdTv1R15WqJpeXh9tc4QCws1bYbhwRK4lZVGRze+7mWGM 1qthjrqaiiYK3sZOlLQoXmtRBsjsPoys9YBbIG7tSmC79iE0ZerJZzVnMl4FbggDTXjI F3oShODxZFLC3dEcMvgLYQqm5RXsXNgQDt1JgqPs63dwL7ybiYnpmApt2H/hR1F1I4kA xoaTSGWl0x7mapEyTPrAwF4LjCTjmWO+uR6d2HX/8Vq0T8q1EBrULFCJsNibNkkGtvmi 8Hpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=19do7/aiKlElxD4OQNzfB+CulWliRAtPjmyeQkUqyRo=; b=NOERTVjagzBDeXCQ7nDtWG8AtYlau6Y9X2vDJwqsMczGlVX+h4zW3whrt256PlbTHa Ml1MlcOSpVOyKU5+Vn0EXvWI974M0cs0xymbwKC00VHxsePKWtodWFqhY4cj0AfauGfS Xh2RyYY0rUzFJm5G9/Kohp/3Jit0btmto38uJfIzHr89aiY7ezxbRMuxjciAesByKhd2 O59HiHnTezwyiOLq6ZyQyIiNnhp0I8LPDkFr6VmjFfdP5F0H0Y/s3yb3NWbcVZAd5nhD 3SonRRue4RWrE6EFwVdZjiBGMKkLWNuMdEEKsvCHMGT273PRCkQ6PYB8lGXTiu/mAKuh MD0g== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l202-v6si6461588wmd.113.2018.08.19.03.01.34; Sun, 19 Aug 2018 03:01: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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA6AB689720; Sun, 19 Aug 2018 13:01:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-3.mx.upcmail.net (vie01a-qmta-pe01-3.mx.upcmail.net [62.179.121.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7A91B68839C for ; Sun, 19 Aug 2018 13:00:58 +0300 (EEST) Received: from [172.31.218.45] (helo=vie01a-dmta-pe05-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1frKWS-0004y2-Kl for ffmpeg-devel@ffmpeg.org; Sun, 19 Aug 2018 12:01:24 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1frKWM-00005u-RH for ffmpeg-devel@ffmpeg.org; Sun, 19 Aug 2018 12:01:18 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Qy191y00b0S5wYM01y1AGX; Sun, 19 Aug 2018 12:01:10 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 Aug 2018 12:01:04 +0200 Message-Id: <20180819100104.25148-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mpeg4videodec: Fix slice end detection in mpeg4_decode_studio_mb() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/mpeg4videodec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 24c280df46..1686ed1001 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1955,6 +1955,14 @@ static int mpeg4_decode_studio_mb(MpegEncContext *s, int16_t block_[12][64]) return SLICE_END; } + //vcon-stp9L1.bits (first frame) + if (get_bits_left(&s->gb) == 0) + return SLICE_END; + + //vcon-stp2L1.bits, vcon-stp3L1.bits, vcon-stp6L1.bits, vcon-stp7L1.bits, vcon-stp8L1.bits, vcon-stp10L1.bits (first frame) + if (get_bits_left(&s->gb) < 8U && show_bits(&s->gb, get_bits_left(&s->gb)) == 0) + return SLICE_END; + return SLICE_OK; }