History

avfilter/avfilter: fix null pointer dereference with queued ping filters

Michael Niedermayer committed 13 years ago

Commit bb23bf81 parent 9b07d341 file · +8 −0Browse files

Unified · Split

libavfilter/avfilter.c+8−0
@@ -427,7 +427,15 @@ void ff_update_link_current_pts(AVFilterLink *link, int64_t pts) · 426 unmodified lines
427427 int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)
428428 {
429429 if(!strcmp(cmd, "ping")){
430+ char local_res[256] = {0};
431+
432+ if (!res) {
433+ res = local_res;
434+ res_len = sizeof(local_res);
435+ }
430436 av_strlcatf(res, res_len, "pong from:%s %s\n", filter->filter->name, filter->name);
437+ if (res == local_res)
438+ av_log(filter, AV_LOG_INFO, "%s", res);
431439 return 0;
432440 }else if(!strcmp(cmd, "enable")) {
433441 return set_enable_expr(filter, arg);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t