lavf/{srt,microdvd}: correctly raise error on avformat_new_stream() error.
This commit is contained in:
parent
9b6f2c7483
commit
608bda925a
@ -62,7 +62,7 @@ static int microdvd_read_header(AVFormatContext *s)
|
|||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (!st)
|
if (!st)
|
||||||
return -1;
|
return AVERROR(ENOMEM);
|
||||||
for (i=0; i<FF_ARRAY_ELEMS(microdvd->lines); i++) {
|
for (i=0; i<FF_ARRAY_ELEMS(microdvd->lines); i++) {
|
||||||
microdvd->pos[i] = avio_tell(s->pb);
|
microdvd->pos[i] = avio_tell(s->pb);
|
||||||
ff_get_line(s->pb, microdvd->lines[i], sizeof(microdvd->lines[i]));
|
ff_get_line(s->pb, microdvd->lines[i], sizeof(microdvd->lines[i]));
|
||||||
|
@ -44,7 +44,7 @@ static int srt_read_header(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
AVStream *st = avformat_new_stream(s, NULL);
|
AVStream *st = avformat_new_stream(s, NULL);
|
||||||
if (!st)
|
if (!st)
|
||||||
return -1;
|
return AVERROR(ENOMEM);
|
||||||
avpriv_set_pts_info(st, 64, 1, 1000);
|
avpriv_set_pts_info(st, 64, 1, 1000);
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
||||||
st->codec->codec_id = CODEC_ID_SRT;
|
st->codec->codec_id = CODEC_ID_SRT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user