[FFmpeg-trac] #2955(undetermined:new): ffprobe will output invalid XML
FFmpeg
trac at avcodec.org
Thu Sep 12 21:22:52 CEST 2013
#2955: ffprobe will output invalid XML
-------------------------------------+-------------------------------------
Reporter: eelco | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
When using XML output for ffprobe, there are cases where ffprobe will
output invalid XML.
We have found several cases of files (‘in the wild’) containing metadata
causing this problem.
{{{
% ffprobe -show_format -print_format xml metadata-with-control-
characters.avi > metadata-with-control-characters.xml
ffprobe version N-56246-g16837f9 Copyright (c) 2007-2013 the FFmpeg
developers
built on Sep 12 2013 21:13:18 with llvm-gcc 4.2.1 (LLVM build
2336.11.00)
configuration: --extra-cflags='-DMACOSX_DEPLOYMENT_TARGET=10.6 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
-mmacosx-version-min=10.6' --extra-ldflags='-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
-mmacosx-version-min=10.6'
libavutil 52. 43.100 / 52. 43.100
libavcodec 55. 31.101 / 55. 31.101
libavformat 55. 16.102 / 55. 16.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 84.100 / 3. 84.100
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
Input #0, avi, from 'metadata-with-control-characters.avi':
Metadata:
artist : 125
comment : ?
copyright : 8536
encoder : Lavf55.15.100
Duration: 00:00:01.01, start: 0.000000, bitrate: 9629 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658),
yuv420p, 512x384 [SAR 1:1 DAR 4:3], 29.97 tbr, 29.97 tbn, 29.98 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p,
136 kb/s
}}}
In this case a character that is illegal in XML (0x12, see
http://www.w3.org/TR/REC-xml/#charsets for allowed characters) is not
scrubbed from the metadata.
(Using an XML library instead of concatenating strings would prevent these
kinds of bugs.)
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2955>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list