OSDN Git Service

Merge commit 'da7e31a240f276836a0b90ca6c0714181b353cc4'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 20:42:08 +0000 (21:42 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 20:42:36 +0000 (21:42 +0100)
* commit 'da7e31a240f276836a0b90ca6c0714181b353cc4':
  rmdec: Check memory allocations from ff_rm_alloc_rmstream()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/rdt.c
libavformat/rmdec.c

Simple merge
@@@ -570,15 -493,15 +574,17 @@@ static int rm_read_header(AVFormatConte
              duration = avio_rb32(pb); /* duration */
              st->start_time = start_time;
              st->duration = duration;
 +            if(duration>0)
 +                s->duration = AV_NOPTS_VALUE;
              get_str8(pb, buf, sizeof(buf)); /* desc */
 -            get_str8(pb, buf, sizeof(buf)); /* mimetype */
 +            get_str8(pb, mime, sizeof(mime)); /* mimetype */
              st->codec->codec_type = AVMEDIA_TYPE_DATA;
              st->priv_data = ff_rm_alloc_rmstream();
+             if (!st->priv_data)
+                 return AVERROR(ENOMEM);
              if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data,
 -                                          avio_rb32(pb)) < 0)
 -                return -1;
 +                                          avio_rb32(pb), mime) < 0)
 +                goto fail;
              break;
          case MKTAG('D', 'A', 'T', 'A'):
              goto header_end;