From patchwork Sun Jun 30 22:47:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 13780 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 AF3C944804F for ; Mon, 1 Jul 2019 01:47:42 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 89C38689D14; Mon, 1 Jul 2019 01:47:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2A53F6882B9 for ; Mon, 1 Jul 2019 01:47:36 +0300 (EEST) Received: by mail-io1-f65.google.com with SMTP id e3so24385172ioc.12 for ; Sun, 30 Jun 2019 15:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=TeQ9VI25gb4WHvoHeF7qXDJyUKvK4C7Vijxww2YQooc=; b=JhTiwqfFmpb0/86bBCsihOJvFkhQ3zSHagw128PGCsg5Fjyx9TZOgO6cWAmU1SwSWo FGM4spEuggLVkUBQ6JWqE6VtxS0oiqywbNHuUhXzTLhyDFxF+H1IQcy5MwwmdORJXps8 KgAOf16loX+qEc47caRzKicrGIWnVJf/zUyROyBaBopPjeOpIrPqJjGuMj4JyotGAGQo EHRmGS4VRO3akvgCMDG/A7QIjrc/aZeaV+WsvSu/A7G02/t5UmxCJRW9ty+6vuGo+wOV aVO7axApPgTldz412T0YbxuKQOC9PhOOYPlLQnqxbsTJy0GTCEYZYymRUdKz4Mi6IrjP 3CDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=TeQ9VI25gb4WHvoHeF7qXDJyUKvK4C7Vijxww2YQooc=; b=tj6gEMiP3uelxLat0KbZJ/n6eheTEcCHwrrZR5i6600HNjBnNbqvDcvmlNul4Ftvgw i+vZUMJM6Qk6nYMP/vM1k0jR36TKeF7ZBrHZo8x7iaZD/lPX903zK8wYSZLWC1ttjXwx dWN31asiIjUh8KPWkBgoqQ5DR01R28hrTsaaRHOiGSSZFkZ9GFT2uqBGzlxcKavyGsvf 4xAK4+4nTjiquxzy8oA4l+pV3uLFG1Hr+XDcC/Bib812V69eFSgje+mfrXwHDm1PT9cj CxrUm46wAKFVA1aTzRCLmatnSqQNfCMdpGbZIxVrTryfEwilOfKLYpN4yboKbb/sTLFU CWxw== X-Gm-Message-State: APjAAAUg00dsHF2QYZkiM2AaCal7Wto6yce2cX/ThK3qxe5LSlHT1z6p Vsf1PgC0YdV8TtkGZ2BoyNOgr7Q9ixJxz5Kl+3ri5g== X-Google-Smtp-Source: APXvYqwKt+Q8Cntp24XX+1ayhkJHBjudCCN5dJmgvMQOI2XAqvyENvYGU3ZbXzmyAS5psSe1zEk982eMe8WKYqwiuBk= X-Received: by 2002:a5d:9ec4:: with SMTP id a4mr19379508ioe.125.1561934854928; Sun, 30 Jun 2019 15:47:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Carl Eugen Hoyos Date: Mon, 1 Jul 2019 00:47:23 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH]lavf/rawenc: Only accept the appropriate stream type for raw muxers 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" Am Mo., 1. Juli 2019 um 00:40 Uhr schrieb Carl Eugen Hoyos : > > Hi! > > Attached patch fixes ticket #7979 for me. Now attached. > Please comment, Carl Eugen From 702506c37b239bf26335fb8f42d06511b8604bb5 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 1 Jul 2019 00:37:08 +0200 Subject: [PATCH] lavf/rawenc: Only accept the appropriate stream type for raw muxers. This does not affect the rawvideo muxer. Fixes ticket #7979. --- libavformat/rawenc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 993d232b70..32704f9bfd 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -39,6 +39,18 @@ static int force_one_stream(AVFormatContext *s) s->oformat->name); return AVERROR(EINVAL); } + if ( s->oformat->audio_codec != AV_CODEC_ID_NONE + && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) { + av_log(s, AV_LOG_ERROR, "%s files have exactly one audio stream\n", + s->oformat->name); + return AVERROR(EINVAL); + } + if ( s->oformat->video_codec != AV_CODEC_ID_NONE + && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) { + av_log(s, AV_LOG_ERROR, "%s files have exactly one video stream\n", + s->oformat->name); + return AVERROR(EINVAL); + } return 0; } -- 2.22.0