webp reader: initialize WebPDecoderConfig

This commit is contained in:
Dane Springmeyer 2014-06-12 20:54:50 -07:00
parent 7960be55fe
commit 49c01f8449

View file

@ -189,6 +189,10 @@ void webp_reader<T>::init()
{ {
WebPDecoderConfig config; WebPDecoderConfig config;
config_guard guard(config); config_guard guard(config);
if (!WebPInitDecoderConfig(&config))
{
throw image_reader_exception("WEBP reader: WebPInitDecoderConfig failed");
}
if (WebPGetFeatures(buffer_->data(), buffer_->size(), &config.input) == VP8_STATUS_OK) { if (WebPGetFeatures(buffer_->data(), buffer_->size(), &config.input) == VP8_STATUS_OK) {
width_ = config.input.width; width_ = config.input.width;
height_ = config.input.height; height_ = config.input.height;