if (ret < 0)
return ret;
- if (buf_end - buf < maplength)
+ /* scanlines are aligned on 16 bit boundaries */
+ len = (depth * w + 7) >> 3;
+ alen = len + (len & 1);
+
+ if (buf_end - buf < maplength + (len * h) * 3 / 256)
return AVERROR_INVALIDDATA;
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
stride = p->linesize[0];
}
- /* scanlines are aligned on 16 bit boundaries */
- len = (depth * w + 7) >> 3;
- alen = len + (len & 1);
-
if (type == RT_BYTE_ENCODED) {
int value, run;
uint8_t *end = ptr + h * stride;
return buf - bufstart;
}
-AVCodec ff_sunrast_decoder = {
+const AVCodec ff_sunrast_decoder = {
.name = "sunrast",
.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
.type = AVMEDIA_TYPE_VIDEO,