diff --git a/main/rtp.c b/main/rtp.c
index 71058df6d6fe914dab8591006801c6fc6e6b5937..e64ab12ead0b0ce0a5e7e0e7de1d022754c79625 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -2862,7 +2862,7 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
 			ast_smoother_feed(rtp->smoother, _f);
 		}
 
-		while ((f = ast_smoother_read(rtp->smoother)))
+		while ((f = ast_smoother_read(rtp->smoother)) && (f->data))
 			ast_rtp_raw_write(rtp, f, codec);
 	} else {
 	        /* Don't buffer outgoing frames; send them one-per-packet: */
@@ -2870,7 +2870,8 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
 			f = ast_frdup(_f);	/*! \bug XXX this might never be free'd. Why do we do this? */
 		else
 			f = _f;
-		ast_rtp_raw_write(rtp, f, codec);
+		if (f->data)
+			ast_rtp_raw_write(rtp, f, codec);
 		if (f != _f)
 			ast_frfree(f);
 	}