]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mtv.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / mtv.c
index dcf4aa428807203440f2d0761e8d9494bca67adf..26a0fd0ea4b60c55159e44bff2d3c8bc3e80efc2 100644 (file)
@@ -51,7 +51,7 @@ typedef struct MTVDemuxContext {
 
 } MTVDemuxContext;
 
-static int mtv_probe(AVProbeData *p)
+static int mtv_probe(const AVProbeData *p)
 {
     /* we need at least 57 bytes from the header
      * to try parsing all required fields
@@ -171,6 +171,8 @@ static int mtv_read_header(AVFormatContext *s)
     st->codecpar->width           = mtv->img_width;
     st->codecpar->height          = mtv->img_height;
     st->codecpar->extradata       = av_strdup("BottomUp");
+    if (!st->codecpar->extradata)
+        return AVERROR(ENOMEM);
     st->codecpar->extradata_size  = 9;
 
     // audio - mp3
@@ -223,7 +225,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
     return ret;
 }
 
-AVInputFormat ff_mtv_demuxer = {
+const AVInputFormat ff_mtv_demuxer = {
     .name           = "mtv",
     .long_name      = NULL_IF_CONFIG_SMALL("MTV"),
     .priv_data_size = sizeof(MTVDemuxContext),