[Mplayer-cvslog] CVS: main/libvo jpeg_enc.c,1.20,1.21

Rik Snel CVS syncmail at mplayerhq.hu
Mon Feb 16 15:41:46 CET 2004


CVS change done by Rik Snel CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv25792

Modified Files:
	jpeg_enc.c 
Log Message:
fixing segfault: libavcodec doesn't allocate some buffers if avctx->thread_count == 0

Index: jpeg_enc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/jpeg_enc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- jpeg_enc.c	6 Feb 2004 17:21:02 -0000	1.20
+++ jpeg_enc.c	16 Feb 2004 14:41:42 -0000	1.21
@@ -352,6 +352,9 @@
 	/* alloc bogus avctx to keep MPV_common_init from segfaulting */
 	j->s->avctx = calloc(sizeof(*j->s->avctx), 1);
 
+	/* make MPV_common_init allocate important buffers, like s->block */
+	j->s->avctx->thread_count = 1;
+
 	if (MPV_common_init(j->s) < 0) {
 		av_free(j->s);
 		av_free(j);




More information about the MPlayer-cvslog mailing list