]> git.sesse.net Git - ffmpeg/commitdiff
lavf/{srt,microdvd}: correctly raise error on avformat_new_stream() error.
authorClément Bœsch <ubitux@gmail.com>
Fri, 15 Jun 2012 16:40:14 +0000 (18:40 +0200)
committerClément Bœsch <ubitux@gmail.com>
Fri, 15 Jun 2012 16:40:14 +0000 (18:40 +0200)
libavformat/microdvddec.c
libavformat/srtdec.c

index 5e37bc38a3b2c9532d0ccd5c724de861563b11b9..b1229fae01f36efa03d953ab111540a568d08df4 100644 (file)
@@ -62,7 +62,7 @@ static int microdvd_read_header(AVFormatContext *s)
     char c;
 
     if (!st)
-        return -1;
+        return AVERROR(ENOMEM);
     for (i=0; i<FF_ARRAY_ELEMS(microdvd->lines); i++) {
         microdvd->pos[i] = avio_tell(s->pb);
         ff_get_line(s->pb, microdvd->lines[i], sizeof(microdvd->lines[i]));
index 481f4a6bb03f172b850a75f96481ae440e56c3e3..9cd393ef7f83fc60599a57c748ee6758c66a596b 100644 (file)
@@ -44,7 +44,7 @@ static int srt_read_header(AVFormatContext *s)
 {
     AVStream *st = avformat_new_stream(s, NULL);
     if (!st)
-        return -1;
+        return AVERROR(ENOMEM);
     avpriv_set_pts_info(st, 64, 1, 1000);
     st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
     st->codec->codec_id   = CODEC_ID_SRT;