| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Theora
Revision: 15144
Author: giles
Date: 01 Aug 2008 04:49:56
Changes:Check for an uninitialized state before dereferencing in propagating
decode calls. Annodex ticket 409.
| ... | ...@@ -167,12 +167,15 @@ | |
| 167 | 167 | th_api_wrapper *api; |
| 168 | 168 | ogg_int64_t gp; |
| 169 | 169 | int ret; |
| 170 | ||
| 171 | if(!_td || !_td->i || !_td->i->codec_setup)return OC_FAULT; | |
| 170 | 172 | api=(th_api_wrapper *)_td->i->codec_setup; |
| 173 | if(!api || !api->decode)return OC_FAULT; | |
| 171 | 174 | ret=th_decode_packetin(api->decode,_op,&gp); |
| 172 | 175 | |
| 173 | 176 | #ifdef _TH_DEBUG_ |
| 174 | 177 | dframe++; |
| 175 | #endif | |
| 178 | #endif | |
| 176 | 179 | |
| 177 | 180 | if(ret<0)return OC_BADPACKET; |
| 178 | 181 | _td->granulepos=gp; |
| ... | ...@@ -184,7 +187,9 @@ | |
| 184 | 187 | th_ycbcr_buffer buf; |
| 185 | 188 | int ret; |
| 186 | 189 | |
| 190 | if(!_td || !_td->i || !_td->i->codec_setup)return OC_FAULT; | |
| 187 | 191 | api=(th_api_wrapper *)_td->i->codec_setup; |
| 192 | if(!api || !api->decode)return OC_FAULT; | |
| 188 | 193 | ret=th_decode_ycbcr_out(api->decode,buf); |
| 189 | 194 | if(ret>=0){ |
| 190 | 195 | _yuv->y_width=buf[0].width; |