changeset 895:b6536a556a45

no codecs - segfault fixed
author arpi_esp
date Sun, 27 May 2001 23:29:03 +0000
parents 11bcf34c0a3e
children d46de26aef48
files codec-cfg.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/codec-cfg.c	Sun May 27 21:18:54 2001 +0000
+++ b/codec-cfg.c	Sun May 27 23:29:03 2001 +0000
@@ -550,8 +550,8 @@
 	if (!validate_codec(codec, codec_type))
 		goto err_out_not_valid;
 	printf("%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs);
-	video_codecs[nr_vcodecs].name = NULL;
-	audio_codecs[nr_acodecs].name = NULL;
+	if(video_codecs) video_codecs[nr_vcodecs].name = NULL;
+	if(audio_codecs) audio_codecs[nr_acodecs].name = NULL;
 	ret_codecs[0] = video_codecs;
 	ret_codecs[1] = audio_codecs;
 out:
@@ -614,6 +614,7 @@
 			i = nr_vcodecs;
 			c = video_codecs;
 		}
+		if(!i) return NULL;
 		for (/* NOTHING */; i--; c++) {
                         if(start && c<=start) continue;
 			for (j = 0; j < CODECS_MAX_FOURCC; j++) {