]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mspdec.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / mspdec.c
index b81d835a638e9b137e2b54d7aea204649743f8cd..44854e99c2197eae5c5bace634eb58f076a7ca5c 100644 (file)
@@ -70,11 +70,12 @@ static int msp_read_header(AVFormatContext *s)
 
     if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
         cntx->packet_size = av_image_get_buffer_size(st->codecpar->format, st->codecpar->width, st->codecpar->height, 1);
-        if (cntx->packet_size < 0)
-            return cntx->packet_size;
     } else
         cntx->packet_size = 2 * st->codecpar->height;
 
+    if (cntx->packet_size <= 0)
+        return cntx->packet_size < 0 ? cntx->packet_size : AVERROR_INVALIDDATA;
+
     return 0;
 }
 
@@ -105,7 +106,7 @@ static int msp_read_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-AVInputFormat ff_msp_demuxer = {
+const AVInputFormat ff_msp_demuxer = {
     .name         = "msp",
     .long_name    = NULL_IF_CONFIG_SMALL("Microsoft Paint (MSP))"),
     .read_probe   = msp_probe,