Commit b100eab8 authored by Michael Niedermayer's avatar Michael Niedermayer

changing size segfault fix

Originally committed as revision 3463 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d32064c0
...@@ -860,9 +860,12 @@ void MPV_common_end(MpegEncContext *s) ...@@ -860,9 +860,12 @@ void MPV_common_end(MpegEncContext *s)
s->last_picture_ptr= s->last_picture_ptr=
s->next_picture_ptr= s->next_picture_ptr=
s->current_picture_ptr= NULL; s->current_picture_ptr= NULL;
s->linesize= s->uvlinesize= 0;
for(i=0; i<3; i++) for(i=0; i<3; i++)
av_freep(&s->visualization_buffer[i]); av_freep(&s->visualization_buffer[i]);
avcodec_default_free_buffers(s->avctx);
} }
#ifdef CONFIG_ENCODERS #ifdef CONFIG_ENCODERS
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
static void avcodec_default_free_buffers(AVCodecContext *s); void avcodec_default_free_buffers(AVCodecContext *s);
void *av_mallocz(unsigned int size) void *av_mallocz(unsigned int size)
{ {
...@@ -760,7 +760,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx) ...@@ -760,7 +760,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
avctx->codec->flush(avctx); avctx->codec->flush(avctx);
} }
static void avcodec_default_free_buffers(AVCodecContext *s){ void avcodec_default_free_buffers(AVCodecContext *s){
int i, j; int i, j;
if(s->internal_buffer==NULL) return; if(s->internal_buffer==NULL) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment