X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ftxd.c;h=86d60f33777346a675f008a00ad81e3b7661b736;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=8b20475d3925dd9cba750775ec6b4c7eb7702f17;hpb=0dda0f3bdb7e8a2d5bef7457375f72f38a100ccb;p=ffmpeg diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 8b20475d392..86d60f33777 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -43,6 +43,9 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, int i, j; int ret; + if (avpkt->size < 88) + return AVERROR_INVALIDDATA; + ff_texturedsp_init(&dxtc); bytestream2_init(&gb, avpkt->data, avpkt->size); @@ -152,7 +155,7 @@ unsupported: return AVERROR_PATCHWELCOME; } -AVCodec ff_txd_decoder = { +const AVCodec ff_txd_decoder = { .name = "txd", .long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"), .type = AVMEDIA_TYPE_VIDEO,