diff options
author | Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> | 2004-07-16 18:36:39 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-07-16 18:36:39 +0000 |
commit | 6cfe51d9dab860515bf1bb6fb703dd5bddeeb4e7 (patch) | |
tree | 126a8553239242af119a50662cb6f8c379dd7622 | |
parent | 6206f8c92093044fb298ff19d7192d774d50909e (diff) | |
download | ffmpeg-streaming-6cfe51d9dab860515bf1bb6fb703dd5bddeeb4e7.zip ffmpeg-streaming-6cfe51d9dab860515bf1bb6fb703dd5bddeeb4e7.tar.gz |
Avoid segfault on ffmpeg "buffer flush" in mpeg12.c patch by (Wolfram Gloger <wmglo at dent dot med dot uni-muenchen dot de>)
Originally committed as revision 3324 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mpeg12.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 9acdd2e..5a2df29 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2769,12 +2769,14 @@ static int mpeg_decode_frame(AVCodecContext *avctx, 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; } |