- Segfault fixed when liba52 dynamic library isn't found.
authorJuanjo <pulento@users.sourceforge.net>
Mon, 6 May 2002 21:34:50 +0000 (21:34 +0000)
committerJuanjo <pulento@users.sourceforge.net>
Mon, 6 May 2002 21:34:50 +0000 (21:34 +0000)
Originally committed as revision 449 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c
libavcodec/a52dec.c

index 7d5a66f64fd0bca72bed840d46b4da3b57fef36e..6df63d033949a61bbe4fad5ab18649434f11ce6d 100644 (file)
--- 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));
index 7ed9ba9791e6aa8c62878bb62784a9b3761a2ca2..d639b8ae30ee24af3bff5a8c9f6d21d5972a6234 100644 (file)
@@ -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");