From fffcb5e8412c8d1304b07eee7ac2d79cf280a1f4 Mon Sep 17 00:00:00 2001 From: Juanjo Date: Mon, 6 May 2002 21:34:50 +0000 Subject: - Segfault fixed when liba52 dynamic library isn't found. Originally committed as revision 449 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 4 +++- libavcodec/a52dec.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 7d5a66f..6df63d0 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1490,7 +1490,9 @@ int find_codec_parameters(AVFormatContext *ic) ret = -1; goto the_end; } - avcodec_open(&st->codec, codec); + ret = avcodec_open(&st->codec, codec); + if (ret < 0) + goto the_end; } } pktl = av_mallocz(sizeof(AVPacketList)); diff --git a/libavcodec/a52dec.c b/libavcodec/a52dec.c index 7ed9ba9..d639b8a 100644 --- a/libavcodec/a52dec.c +++ b/libavcodec/a52dec.c @@ -80,7 +80,7 @@ static int a52_decode_init(AVCodecContext *avctx) s->handle = dlopen(liba52name, RTLD_LAZY); if (!s->handle) { - fprintf(stderr, "A52 library %s could not be opened: %s\n", liba52name, dlerror()); + fprintf(stderr, "A52 library %s could not be opened! \n%s\n", liba52name, dlerror()); return -1; } s->a52_init = (a52_state_t* (*)(uint32_t)) dlsymm(s->handle, "a52_init"); -- cgit v1.1