X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=main%2Fslinfactory.c;h=2e6e4719357240cc336330902b07e44eaf37df2e;hp=0e3a39b222531a90627c7f1bfdbda0af20401664;hb=fc7455fa4438db7b16a667d706e405196d5eb452;hpb=04e56bde030a6b8285fab1df046abb2d60700854 diff --git a/main/slinfactory.c b/main/slinfactory.c index 0e3a39b..2e6e471 100644 --- a/main/slinfactory.c +++ b/main/slinfactory.c @@ -82,6 +82,16 @@ int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f) struct ast_frame *begin_frame = f, *duped_frame = NULL, *frame_ptr; unsigned int x; + /* In some cases, we can be passed a frame which has no data in it, but + * which has a positive number of samples defined. Once such situation is + * when a jitter buffer is in use and the jitter buffer interpolates a frame. + * The frame it produces has data set to NULL, datalen set to 0, and samples + * set to either 160 or 240. + */ + if (!f->data.ptr) { + return 0; + } + if (f->subclass != AST_FORMAT_SLINEAR && f->subclass != AST_FORMAT_SLINEAR16) { if (sf->trans && f->subclass != sf->format) { ast_translator_free_path(sf->trans);