summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-03-21 11:46:15 -0400
committerAttila Nagy <attilanagy@google.com>2011-03-24 15:05:10 +0200
commit744a58bc1cb6c01ef7a1fbde63ea77ae73089b89 (patch)
tree9718cd7a2a2895b7e5a95ef3ae112c1ca49f6ab7
parent86b5556f5af7bd3c1a7821475aee4c1ace4e003b (diff)
downloadlibvpx-sandbox/atna/dec_sem_sync.tar.gz
vpx_codec_dec_init: check that the iface is a decodersandbox/atna/dec_sem_sync
Make sure the given interface is actually a decoder interface before initializing it. Change-Id: Ie48d737f2956cc2f0891666de5ea87251e96bc49
-rw-r--r--vpx/src/vpx_decoder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vpx/src/vpx_decoder.c b/vpx/src/vpx_decoder.c
index fe6ea75aa..4ffb00d32 100644
--- a/vpx/src/vpx_decoder.c
+++ b/vpx/src/vpx_decoder.c
@@ -36,6 +36,8 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
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));