From patchwork Wed Dec 9 22:38:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 24463 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 5D09344B716 for ; Thu, 10 Dec 2020 00:39:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2B84C68A43D; Thu, 10 Dec 2020 00:39:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DF16A6899A9 for ; Thu, 10 Dec 2020 00:39:11 +0200 (EET) Received: by mail-pl1-f170.google.com with SMTP id j1so1743780pld.3 for ; Wed, 09 Dec 2020 14:39:11 -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=R7pxF+KIlU9+wT08bLOBwyXKOOIG4ARi1/lNCAuUxSs=; b=EK5agyc95lRCOztiVUo40ID9C2vN9OLWEz7n6tGJxguNNdoHKMUGX+UoE43Xd59EUh uKtkg92hroheC04+HafCScJrCLiYy2GXCs97zN3qecFTqL9QdFMPN+2HTkCC9eU0E21P 2AOOrC3paiITK94drD3dvM6WmIzItxxPp8/JxGTuVl8lWlh6l6w1CtBEVUU58U7oC6gY /YJFJmV85+/kais3WmuPyWG1JOjsgrVHZyR81YSb5NHjZy68sDHgVvjde6hOLM09Z/Xc e6frp5Ueu7kdkGHvU8e5b2PdwOFO+vVKb98xViLZObjX2USLySUMrVgeIPyiJNDgIqrx LRgA== 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=R7pxF+KIlU9+wT08bLOBwyXKOOIG4ARi1/lNCAuUxSs=; b=cJct8rXXnchjNXZBqHVBriJisbv8Wl6MOOOYJmxpZ4sAK1I30x3Qg0/zkiCElvjSP/ YDpJCagtcen2c2qsHGULNqloxfPwmm6Va9ZDhsMdHUR6R7xQfMJJje2QQL3OnSCwdhvk YrEHNon5z6ZZrEt11/D/KK253vgtYvmJc0W/x9cuHx0xpq4aFy7dO9oIHucL8x9BaHay MkzeJ0OQvFmD41LVkO0Xa51E3RWKdtYjFOyydhrcV05DwvXDCY2YGdALi4V9KKDmtImS QQiVUsNIaqZzR49HFkZ1l2FMg0HJEp3gBxuxj0m3D5DesekcKS264aJvJSj2RCT91rbH 9PDg== X-Gm-Message-State: AOAM531p7PZClhL88m4Qp8NI4PacIwd9FArRhxYwLbZLkJnta0BNA8fr psNhgT3X3l/l+iHdeD3V5fECT6xoe8rSPFN6Dk3Ly6zGk/Y= X-Google-Smtp-Source: ABdhPJwtJ5NmYLNQDvdlvxOp1bbTZP7JnwbJ3/+JFgmFo/+Pc7sZcJSldV8CNK7VWjHy/xFc6hRRlR9YWqH2MRj946A= X-Received: by 2002:a17:902:c3d2:b029:da:73c5:c589 with SMTP id j18-20020a170902c3d2b02900da73c5c589mr4149600plj.71.1607553549804; Wed, 09 Dec 2020 14:39:09 -0800 (PST) MIME-Version: 1.0 From: Carl Eugen Hoyos Date: Wed, 9 Dec 2020 23:38:58 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavf/img2dec: Return a low score for mjpeg when probing jpeg_pipe 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" Hi! Attached patch fixes ticket #9026. Please comment, Carl Eugen Subject: [PATCH] lavf/img2dec: Return a low score for mjpeg when probing jpeg_pipe. Fixes ticket #9026. --- libavformat/img2dec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 4f9bfc635a..faa67d0562 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -760,7 +760,11 @@ static int jpeg_probe(const AVProbeData *p) c = b[i + 1]; switch (c) { case SOI: - return 0; + if (state == EOI) { + return AVPROBE_SCORE_EXTENSION / 8; + } else { + return 0; + } case SOF0: case SOF1: case SOF2: