* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_playlist.h>
#include <vlc_meta.h>
#include <vlc_demux.h>
ByteVector p_data_taglib; const char *p_data; int i_data;
psz_mime = p_apic->mimeType().toCString(true);
- psz_description = p_apic->description().toCString(true);
- psz_name = psz_description;
+ psz_description = psz_name = p_apic->description().toCString(true);
+
+ /* some old iTunes version not only sets incorrectly the mime type
+ * or the description of the image,
+ * but also embeds incorrectly the image.
+ * Recent versions seem to behave correctly */
+ if( !strncmp( psz_mime, "PNG", 3 ) ||
+ !strncmp( psz_name, "\xC2\x89PNG", 5 ) )
+ {
+ msg_Warn( p_demux,
+ "%s: Invalid picture embedded by broken iTunes version, "
+ "you really shouldn't use this crappy software.",
+ (const char *)f.file()->name() );
+ break;
+ }
p_data_taglib = p_apic->picture();
p_data = p_data_taglib.data();
{
demux_t *p_demux = (demux_t *)p_this;
demux_meta_t *p_demux_meta = (demux_meta_t*)p_demux->p_private;
- vlc_meta_t *p_meta = p_demux_meta->p_meta;
+ vlc_meta_t *p_meta;
TAB_INIT( p_demux_meta->i_attachments, p_demux_meta->attachments );
p_demux_meta->p_meta = NULL;