[FFmpeg-cvslog] lavf/{srt, microdvd}: correctly raise error on avformat_new_stream() error.

Clément Bœsch git at videolan.org
Fri Jun 15 18:49:37 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Fri Jun 15 18:40:14 2012 +0200| [608bda925a933be6ffdb91937125b6bba0c8a3d7] | committer: Clément Bœsch

lavf/{srt,microdvd}: correctly raise error on avformat_new_stream() error.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=608bda925a933be6ffdb91937125b6bba0c8a3d7
---

 libavformat/microdvddec.c |    2 +-
 libavformat/srtdec.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c
index 5e37bc3..b1229fa 100644
--- a/libavformat/microdvddec.c
+++ b/libavformat/microdvddec.c
@@ -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]));
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 481f4a6..9cd393e 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list