From 8ddf569e8692d3b5cd7345682806733ab1153a6b Mon Sep 17 00:00:00 2001 From: rik Date: Thu, 29 Aug 2002 11:41:11 +0000 Subject: [PATCH] fixes a segfault which was introduced in this file by the new ratecontrol code git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7137 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/jpeg_enc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvo/jpeg_enc.c b/libvo/jpeg_enc.c index 0fd89d8977..452c420e55 100644 --- a/libvo/jpeg_enc.c +++ b/libvo/jpeg_enc.c @@ -338,6 +338,9 @@ jpeg_enc_t *jpeg_enc_init(int w, int h, int y_psize, int y_rsize, return NULL; } + /* alloc bogus avctx to keep MPV_common_init from segfaulting */ + j->s->avctx = calloc(sizeof(*j->s->avctx), 1); + if (MPV_common_init(j->s) < 0) { free(j->s); free(j);