shithub: libvpx

Download patch

ref: 2fced87e75212f43787f7114de5317c35e77a965
parent: 2cbd9620880a4335aef7e4b6befe1d334893930f
author: John Koleszar <jkoleszar@google.com>
date: Mon Mar 21 07:46:15 EDT 2011

vpx_codec_dec_init: check that the iface is a decoder

Make sure the given interface is actually a decoder interface before
initializing it.

Change-Id: Ie48d737f2956cc2f0891666de5ea87251e96bc49

--- a/vpx/src/vpx_decoder.c
+++ b/vpx/src/vpx_decoder.c
@@ -36,6 +36,8 @@
         res = VPX_CODEC_INCAPABLE;
     else if ((flags & VPX_CODEC_USE_POSTPROC) && !(iface->caps & VPX_CODEC_CAP_POSTPROC))
         res = VPX_CODEC_INCAPABLE;
+    else if (!(iface->caps & VPX_CODEC_CAP_DECODER))
+        res = VPX_CODEC_INCAPABLE;
     else
     {
         memset(ctx, 0, sizeof(*ctx));
--