Quoting Luca Barbato (2014-09-29 20:59:28) > On 29/09/14 20:58, Anton Khirnov wrote: > > Quoting Luca Barbato (2014-09-28 11:08:08) > >> Prevent a segfault on close. > >> > >> CC: [email protected] > >> --- > >> > >> avplay.c | 18 ++++++++++++------ > >> 1 file changed, 12 insertions(+), 6 deletions(-) > >> > >> diff --git a/avplay.c b/avplay.c > >> index 58da984..338a881 100644 > >> --- a/avplay.c > >> +++ b/avplay.c > >> @@ -1269,13 +1269,17 @@ static void alloc_picture(void *opaque) > >> SDL_FreeYUVOverlay(vp->bmp); > >> > >> #if CONFIG_AVFILTER > >> - vp->width = is->out_video_filter->inputs[0]->w; > >> - vp->height = is->out_video_filter->inputs[0]->h; > >> - vp->pix_fmt = is->out_video_filter->inputs[0]->format; > >> + if (is->out_video_filter) { > >> + vp->width = is->out_video_filter->inputs[0]->w; > >> + vp->height = is->out_video_filter->inputs[0]->h; > >> + vp->pix_fmt = is->out_video_filter->inputs[0]->format; > >> + } else > > > > Why would this be the correct behaviour? > > > > I'd expect that if the filter has been freed, we don't want to allocate > > any new frames, so we return an error here. > > > > Sadly we'd have a crash since we could have pending allocation events. > > Might be better flush the queue I guess. >
Looking at the current code more closely, it looks horribly unsafe. There should either be some locking around accessing the filter or the frame allocation code should not touch it at all. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
