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;
}
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,