From patchwork Sat Feb 2 19:34:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 11959 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 BF911446957 for ; Sat, 2 Feb 2019 21:51:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8F7FC68A4C3; Sat, 2 Feb 2019 21:51:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B34F68A3AD for ; Sat, 2 Feb 2019 21:51:46 +0200 (EET) Received: by mail-wr1-f67.google.com with SMTP id p4so10535017wrt.7 for ; Sat, 02 Feb 2019 11:51:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1JZvlOEIJ/6TpFJ6RNAXrXus9UuQjTHJ/4C2iKxDhr8=; b=FQ2jk2eJSvu7/qLiwmwGyyARbWp72NEL6zInsOqO8FzO2gH4YS+8il8qQBEM/WSIN3 w81Ti2efi9z6Aeqoonu2gBUM6+QztE7KVZCeAEaJ27JngSn/f19+RA6VESgLo6LnmTzv JeMEgqb950BdOGAiELeRJRHwnpwXXgBNxvO/Xfvg/2UiuPW5fUaXqHbbxHl8bjidUwwI dtCXYnp75ZgJZhdOcFAmkUvGYJXtQk1218cjdjddDQtMmQUVjGoDQvVNpuDF/DG2RtRy zoMBERpVvPJW7dAIoofJVfZiN1MlCKI/zziwjWwc7pny0TggKOjdWCboC52ozmZobTFV NV8Q== 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:mime-version :content-transfer-encoding; bh=1JZvlOEIJ/6TpFJ6RNAXrXus9UuQjTHJ/4C2iKxDhr8=; b=U8K3o1wPkMiDd2+lDXnTn9qilQla9Mg4lRpAi2OgDmTDGIo4U2lQcI5bHX4pyv37vZ sFIIY2CUMKtCPE2rC3qdi3LGBl1bCHHTcQ32I/wM4hZ8PaOlse5zl5IbYKPnGPokDhbG hBlvg21/4Yzf3mOLNL/YklSaYu8yV4g2WWkNkQRBkfoCUU6npLVMeMI/YW4j9RMJWrqv 1YMKYGclhGMDFqbLu6lFmSqm7D7rN2c72X6x4ZCoTJEAVdpGO3AedJ3JZ/otz2RDeFFQ 0KYhVVwpQFqR8sjQVVoHZbWpFVBBS0GPN2LN6Jh0Ln0dmtBhiFDr2DZH7AsY1SISAEJd sUbQ== X-Gm-Message-State: AJcUukexjM0DU54bGILmwd9pfyc2gy7KWzAjc7xAJN9W0DtUraamwSKX F9Udpm8OumG7yAY7Jz66YI0QrAUC X-Google-Smtp-Source: ALg8bN42qQBP9cN+RFXvKgZ5Kn08Qi08tpP2y+mBet6xf3+7SCNr6q3/ytKC3nc4eypdxS5JUyxk+Q== X-Received: by 2002:a5d:528e:: with SMTP id c14mr43168987wrv.236.1549136616119; Sat, 02 Feb 2019 11:43:36 -0800 (PST) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.googlemail.com with ESMTPSA id z206sm9137622wmc.18.2019.02.02.11.43.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Feb 2019 11:43:35 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 2 Feb 2019 20:34:10 +0100 Message-Id: <20190202193412.572-1-andreas.rheinhardt@googlemail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/mpeg4videodec: Fix nonsense warning 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" Since db772308941a2a338c7809f90d347219a6a93074 parsing of mpeg4-extradata lead to a "Failed to parse extradata" warning, because ff_mpeg4_decode_picture_header returns AVERROR_INVALIDDATA in case that no VOP was found. This patch changes the return value back to -1 in case no error occured and no VOP was found. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg4videodec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index f44ee76bd4..9d820c2d71 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3202,7 +3202,8 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) /** * Decode MPEG-4 headers. - * @return <0 if no VOP found (or a damaged one) + * @return -1 if no error occured, but no VOP was found + * <0 if no VOP found (or a damaged one) * FRAME_SKIPPED if a not coded VOP is found * 0 if a VOP is found */ @@ -3235,6 +3236,8 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb) (ctx->divx_version >= 0 || ctx->xvid_build >= 0) || s->codec_tag == AV_RL32("QMP4")) { av_log(s->avctx, AV_LOG_VERBOSE, "frame skip %d\n", gb->size_in_bits); return FRAME_SKIPPED; // divx bug + } else if (get_bits_count(gb) == gb->size_in_bits) { + return -1; // ordinary return value for parsing of extradata } else return AVERROR_INVALIDDATA; // end of stream }