# HG changeset patch # User michael # Date 1090002999 0 # Node ID 50779a18844c1f27112659c6dc1d404f0923d453 # Parent b601489852018040734ce6cd962986e7b62b865b Avoid segfault on ffmpeg "buffer flush" in mpeg12.c patch by (Wolfram Gloger ) diff -r b60148985201 -r 50779a18844c mpeg12.c --- a/mpeg12.c Fri Jul 16 01:54:07 2004 +0000 +++ b/mpeg12.c Fri Jul 16 18:36:39 2004 +0000 @@ -2769,12 +2769,14 @@ MpegEncContext *s2 = &s->mpeg_enc_ctx; dprintf("fill_buffer\n"); - /* special case for last picture */ - if (buf_size == 0 && s2->low_delay==0 && s2->next_picture_ptr) { - *picture= *(AVFrame*)s2->next_picture_ptr; - s2->next_picture_ptr= NULL; + if (buf_size == 0) { + /* special case for last picture */ + if (s2->low_delay==0 && s2->next_picture_ptr) { + *picture= *(AVFrame*)s2->next_picture_ptr; + s2->next_picture_ptr= NULL; - *data_size = sizeof(AVFrame); + *data_size = sizeof(AVFrame); + } return 0; }