diff options
author | 2001-05-27 23:29:03 +0000 | |
---|---|---|
committer | 2001-05-27 23:29:03 +0000 | |
commit | ba952039710daca949501a164788aa6b0c314aaa (patch) | |
tree | 5e713d435db3a8b61f37be78bd4187c54ff29370 /codec-cfg.c | |
parent | 50ff2ad629a2afb170e76edf4cfd1e0a3bf0a9a9 (diff) |
no codecs - segfault fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@896 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'codec-cfg.c')
-rw-r--r-- | codec-cfg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/codec-cfg.c b/codec-cfg.c index 97566764ff..8e82d72394 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -550,8 +550,8 @@ codecs_t **parse_codec_cfg(char *cfgfile) 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 @@ codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap, 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++) { |