From patchwork Tue Jun 18 00:59:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chcunningham@chromium.org X-Patchwork-Id: 13593 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 37532449800 for ; Tue, 18 Jun 2019 04:31:17 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0ACB9689F2B; Tue, 18 Jun 2019 04:31:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 902B768A7B1 for ; Tue, 18 Jun 2019 04:31:10 +0300 (EEST) Received: by mail-pf1-f194.google.com with SMTP id m30so6623491pff.8 for ; Mon, 17 Jun 2019 18:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=HYmKXjv8Z/uDKp8k6bna426P0tL5yIMLaZgfz1Hy9aQ=; b=A3c0tKTeaa2iYGyeZPmW1WzfGU2yvCCvgjpt0VKP+2gJd4Ak3SPbSTeCXqgMyzkdN4 65hq2geKAGropgkiJy+wQS4hdM/haentahiP0yNYFQxLx+aHj6XRrpD5yHwxr81WZGUB Y6JSZ0RayVln3H972GMHhQDnyMY+lHIrobeVQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=HYmKXjv8Z/uDKp8k6bna426P0tL5yIMLaZgfz1Hy9aQ=; b=OlvWHlyGFDaC7VYRRnGLsoNaNjg9EbUe/vwoXkw9L7VDqX0aonTgwNZuvOeX4NbUcB yhTgIB2GhgONHHzyJIwZVP6mK58A0rJOvo+FdrXSH/mEep8HzfJ0VABjhxvfh8i7CSDW a3oz9Txz3oozKRejfIMhhgKf3Uw5bfi9amiSW+pkfP9b8uIvQaWTURBK3DIK8r5wsb3x BU3xoRoWTOeY6EQsUMQ+RVBp/6byKiJ3eiq7NhqmkV3ajAoHxuR3jojxa/4gkRwEJmhP qvcwv/EXOGqX3ZuhrgXsgjZ0TCtA/gL5Ql7auM/b89A6Qx/1GOfkd3IfsrR4WF1Cqnal fcLQ== X-Gm-Message-State: APjAAAVTQqY2wseMcuI9cYhhsggK14o7CJPc7X5uPFOpfIdc6DESCCwi dCXcbkV9MITBJUUXPlSLWXxWzX3dK3I= X-Google-Smtp-Source: APXvYqxqkYlDurhzKyss3tSPBTrauBG1tdmCwC0jdJa3j+L+iTubfSEsc+Gkib89zGP8h/TE1kbkJA== X-Received: by 2002:a17:90a:25c8:: with SMTP id k66mr2125015pje.129.1560819661430; Mon, 17 Jun 2019 18:01:01 -0700 (PDT) Received: from chcunningham-linux.sea.corp.google.com ([2620:15c:38:200:74b:ad27:5acb:a21]) by smtp.gmail.com with ESMTPSA id u20sm11757253pgm.56.2019.06.17.18.01.00 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 18:01:00 -0700 (PDT) From: Chris Cunningham To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jun 2019 17:59:40 -0700 Message-Id: <20190618005940.197421-1-chcunningham@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/oggdec: only parse headers before data 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" This behavior was added in 2010 to suport some old (and invalid) ogm files. https://github.com/FFmpeg/FFmpeg/commit/81b743eb1026547270b88ac6a5cb451a3907ee94 But this makes it possible to change the codec in the later headers, causing codec to be out of sync with internal avctx (eventually triggering Abrt). Updating the internal ctx for this degenerate case was deemed not worth it. See discussion here: https://patchwork.ffmpeg.org/patch/11983/ --- libavformat/oggdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index e815f42134..19d77f3107 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -545,7 +545,7 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize, ogg->curidx = idx; os->incomplete = 0; - if (os->header) { + if (!ogg->headers) { if ((ret = os->codec->header(s, idx)) < 0) { av_log(s, AV_LOG_ERROR, "Header processing failed: %s\n", av_err2str(ret)); return ret;