Skip to content
Snippets Groups Projects
Commit 6cfe51d9 authored by Wolfram Gloger's avatar Wolfram Gloger Committed by Michael Niedermayer
Browse files

Avoid segfault on ffmpeg "buffer flush" in mpeg12.c patch by (Wolfram Gloger...

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
parent 6206f8c9
No related branches found
No related tags found
No related merge requests found
...@@ -2769,12 +2769,14 @@ static int mpeg_decode_frame(AVCodecContext *avctx, ...@@ -2769,12 +2769,14 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
MpegEncContext *s2 = &s->mpeg_enc_ctx; MpegEncContext *s2 = &s->mpeg_enc_ctx;
dprintf("fill_buffer\n"); dprintf("fill_buffer\n");
/* special case for last picture */ if (buf_size == 0) {
if (buf_size == 0 && s2->low_delay==0 && s2->next_picture_ptr) { /* special case for last picture */
*picture= *(AVFrame*)s2->next_picture_ptr; if (s2->low_delay==0 && s2->next_picture_ptr) {
s2->next_picture_ptr= NULL; *picture= *(AVFrame*)s2->next_picture_ptr;
s2->next_picture_ptr= NULL;
*data_size = sizeof(AVFrame); *data_size = sizeof(AVFrame);
}
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment