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 830f72b7e9)
This commit is contained in:
Pascal Massimino 2013-06-10 05:46:22 -07:00 committed by James Zern
parent a2aed1d08c
commit f32097e0df

View File

@ -436,6 +436,11 @@ int main(int argc, char *argv[]) {
goto Error; 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); kParams.dmux = WebPDemux(&kParams.data);
if (kParams.dmux == NULL) { if (kParams.dmux == NULL) {
fprintf(stderr, "Could not create demuxing object!\n"); fprintf(stderr, "Could not create demuxing object!\n");