mime-type detection results in false-negatives
The mime-type detection associated with spawning a demuxer and
setting the fourcc in src/misc/image.c
does results in
false-positives if the content-type associated with a source stream
contains parameters.
A simple testcase is to try to play an image attachment uploaded here
on trac, as the http-response Content-Type parameter, for some
rather unknown reason, contains charset=utf-8
.
Even though trac does not make sense in including the charset-parameter for images, it is strictly speaking not a violation of the spec as parameters are optional.
% curl -I https://trac.videolan.org/vlc/raw-attachment/ticket/18117/screenshot_vlc_fullscreen_other_monitor_active.png
HTTP/1.1 200 Ok
Server: nginx/1.11.10
Date: Tue, 21 Mar 2017 23:54:21 GMT
Content-Type: image/png; charset=utf-8
Content-Length: 426522
Connection: keep-alive
ETag: W/"anonymous/Wed, 15 Mar 2017 06:40:50 GMT/False"
Content-Disposition: attachment
Last-Modified: Wed, 15 Mar 2017 06:40:50 GMT
Set-Cookie: trac_session=248cefd1a8ac18a484fbd7cb; expires=Mon, 19 Jun 2017 23:54:21 GMT; httponly; Path=/vlc
X-Clacks-Overhead: GNU Terry Pratchett
Non-sensical way to reproduce the issue
In order to demonstrate the issue one can run the below very non-sensical set of commands, resulting in VLC being unable to identify the fourcc for the source image.
% SOURCE_IMAGE="https://trac.videolan.org/vlc/raw-attachment/ticket/18109/vlc_2_2_x.png?prevent-ext-check"
% vlc-devel media.mkv --video-filter='blendbench{blend-image='$SOURCE_IMAGE',base-image='$SOURCE_IMAGE'}'
VLC media player 3.0.0-git Vetinari (revision 2.2.0-git-11831-gffcf2a84df)
[00000000012ee478] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007f48951b2298] core image decoder error: no suitable decoder module for fourcc ` '. VLC probably does not support this image format.
[00007f4894b65508] blendbench filter error: Unable to load Base image
[00007f48ac000978] core video output error: Failed to create video filter 'blendbench'
[00007f48ac000978] core video output error: Failed to add filter 'blendbench