[xiph-commits] r15144 - trunk/theora/lib/dec
giles at svn.xiph.org
giles at svn.xiph.org
Fri Aug 1 01:49:56 PDT 2008
Author: giles
Date: 2008-08-01 01:49:56 -0700 (Fri, 01 Aug 2008)
New Revision: 15144
Modified:
trunk/theora/lib/dec/decapiwrapper.c
Log:
Check for an uninitialized state before dereferencing in propagating
decode calls. Annodex ticket 409.
Modified: trunk/theora/lib/dec/decapiwrapper.c
===================================================================
--- trunk/theora/lib/dec/decapiwrapper.c 2008-07-31 20:42:47 UTC (rev 15143)
+++ trunk/theora/lib/dec/decapiwrapper.c 2008-08-01 08:49:56 UTC (rev 15144)
@@ -167,12 +167,15 @@
th_api_wrapper *api;
ogg_int64_t gp;
int ret;
+
+ if(!_td || !_td->i || !_td->i->codec_setup)return OC_FAULT;
api=(th_api_wrapper *)_td->i->codec_setup;
+ if(!api || !api->decode)return OC_FAULT;
ret=th_decode_packetin(api->decode,_op,&gp);
#ifdef _TH_DEBUG_
dframe++;
-#endif
+#endif
if(ret<0)return OC_BADPACKET;
_td->granulepos=gp;
@@ -184,7 +187,9 @@
th_ycbcr_buffer buf;
int ret;
+ if(!_td || !_td->i || !_td->i->codec_setup)return OC_FAULT;
api=(th_api_wrapper *)_td->i->codec_setup;
+ if(!api || !api->decode)return OC_FAULT;
ret=th_decode_ycbcr_out(api->decode,buf);
if(ret>=0){
_yuv->y_width=buf[0].width;
More information about the commits
mailing list