Mercurial > libavcodec.hg
diff mpeg12.c @ 2130:50779a18844c libavcodec
Avoid segfault on ffmpeg "buffer flush" in mpeg12.c patch by (Wolfram Gloger <wmglo at dent dot med dot uni-muenchen dot de>)
| author | michael |
|---|---|
| date | Fri, 16 Jul 2004 18:36:39 +0000 |
| parents | 3c1dba53954e |
| children | 76334bbb5038 |
line wrap: on
line diff
--- 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; }
