[FFmpeg-devel] ffprobe can produce invalid XML

Ian Ashley iashley at opentext.com
Tue Apr 3 12:54:19 CEST 2012

My original post seemed to be missing the body and only have the attachments so here goes again. Sorry if the full message arrives more than once.

ffprobe can put strings in assets directly into the XML returned. This can result in invalid UTF-8 strings being included in the XML meaning that the XML cannot be parsed by, for example, libxml.

The problem can be reproduced on the latest git head using the attached movie and the command
ffprobe -print_format xml -show_streams -loglevel 0 cnet.mp4
[ alas the movie is too big to post to the mailing list and I don't have a smaller sample that causes the problem, do you have an FTP site where I can post the movie? ]

The output is attached. The invalid character is before the V on the line
<tag key="handler_name" value=" VideoHandler"/>

A patch file produced using diff -u old/ffprobe.c new/ffprobe.c is attached. The replaces the xml_escape_str function by one that replaces any invalid UTF-8 characters by the inverted question mark.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffprobe.output
Type: application/octet-stream
Size: 1331 bytes
Desc: ffprobe.output
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120403/6d7f24f2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffprobe.c.diff
Type: application/octet-stream
Size: 4092 bytes
Desc: ffprobe.c.diff
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120403/6d7f24f2/attachment-0001.obj>

More information about the ffmpeg-devel mailing list