ffserver: dont just crash

With changes from ubitux.
This commit is contained in:
Mike William
2011-05-21 04:50:59 +02:00
committed by Michael Niedermayer
parent ab1c19efc5
commit 840238b870
2 changed files with 6 additions and 5 deletions

View File

@@ -713,6 +713,8 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename)
// FIXME: a more elegant solution is needed
st = av_mallocz(sizeof(AVStream));
memcpy(st, ic->streams[i], sizeof(AVStream));
st->info = av_malloc(sizeof(*st->info));
memcpy(st->info, ic->streams[i]->info, sizeof(*st->info));
st->codec = avcodec_alloc_context();
if (!st->codec) {
print_error(filename, AVERROR(ENOMEM));