From f32097e0df8aa256fc360d3d8d8a0996e039515d Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Mon, 10 Jun 2013 05:46:22 -0700 Subject: [PATCH] probe input file and quick-check for WebP format. Error message is clearer that 'can't create demux object'. Change-Id: Iec008601892f7cd8399e1948751747ac23305eef (cherry picked from commit 830f72b7e988ae0650435f7a285d12e098d7e6ae) --- examples/vwebp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/vwebp.c b/examples/vwebp.c index df389a61..f13b88fc 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -436,6 +436,11 @@ int main(int argc, char *argv[]) { goto Error; } + if (!WebPGetInfo(kParams.data.bytes, kParams.data.size, NULL, NULL)) { + fprintf(stderr, "Input file doesn't appear to be WebP format.\n"); + goto Error; + } + kParams.dmux = WebPDemux(&kParams.data); if (kParams.dmux == NULL) { fprintf(stderr, "Could not create demuxing object!\n");