X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ftxd.c;h=86d60f33777346a675f008a00ad81e3b7661b736;hb=f4df5039a791a56de85c64e6b9e4448a221b5c40;hp=8b20475d3925dd9cba750775ec6b4c7eb7702f17;hpb=50ae1f7e0ff1fa00236622415039f7e28d919a25;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,