[svn-commits] irroot: branch irroot/t38gateway-trunk r319423 - /team/irroot/t38gateway-trun...
    SVN commits to the Digium repositories 
    svn-commits at lists.digium.com
       
    Tue May 17 12:21:12 CDT 2011
    
    
  
Author: irroot
Date: Tue May 17 12:21:08 2011
New Revision: 319423
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319423
Log:
More generic check for bad frame
Modified:
    team/irroot/t38gateway-trunk/res/res_fax_spandsp.c
Modified: team/irroot/t38gateway-trunk/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-trunk/res/res_fax_spandsp.c?view=diff&rev=319423&r1=319422&r2=319423
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax_spandsp.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax_spandsp.c Tue May 17 12:21:08 2011
@@ -716,11 +716,16 @@
 {
 	struct spandsp_pvt *p = s->tech_pvt;
 
+	/*invalid frame*/
+	if (!f->data.ptr || !f->samples) {
+		return 0;
+	}
+
 	/* Process a IFP packet */
-	if (f->data.ptr && (f->frametype == AST_FRAME_MODEM) && (f->subclass.integer == AST_MODEM_T38)) {
+	if ((f->frametype == AST_FRAME_MODEM) && (f->subclass.integer == AST_MODEM_T38)) {
 		t38_core_rx_ifp_packet(p->t38_core_state, f->data.ptr, f->datalen, f->seqno);
 		return 1;
-	} else if (f->data.ptr && (f->frametype == AST_FRAME_VOICE) && (f->subclass.format.id == AST_FORMAT_SLINEAR)) {
+	} else if ((f->frametype == AST_FRAME_VOICE) && (f->subclass.format.id == AST_FORMAT_SLINEAR)) {
 		t38_gateway_rx(&p->t38_gw_state, f->data.ptr, f->samples);
 		return 1;
 	}
    
    
More information about the svn-commits
mailing list