Hi, On Mon, Feb 13, 2012 at 6:16 PM, Paul B Mahol <[email protected]> wrote: > From: Laurent Aimar <[email protected]> > > > Signed-off-by: Paul B Mahol <[email protected]> > --- > libavcodec/txd.c | 22 ++++++++++++++++++++-- > 1 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/txd.c b/libavcodec/txd.c > index 734062a..f6ccfb9 100644 > --- a/libavcodec/txd.c > +++ b/libavcodec/txd.c > @@ -23,6 +23,7 @@ > > #include "libavutil/intreadwrite.h" > #include "libavutil/imgutils.h" > +#include "bytestream.h" > #include "avcodec.h" > #include "s3tc.h" > > @@ -42,6 +43,7 @@ static av_cold int txd_init(AVCodecContext *avctx) { > static int txd_decode_frame(AVCodecContext *avctx, void *data, int > *data_size, > AVPacket *avpkt) { > const uint8_t *buf = avpkt->data; > + const uint8_t *buf_end = avpkt->data + avpkt->size; > TXDContext * const s = avctx->priv_data; > AVFrame *picture = data; > AVFrame * const p = &s->picture; > @@ -52,6 +54,8 @@ static int txd_decode_frame(AVCodecContext *avctx, void > *data, int *data_size, > const uint32_t *palette = (const uint32_t *)(cur + 88); > uint32_t *pal; > > + if (buf_end - cur < 92) > + return AVERROR_INVALIDDATA; > version = AV_RL32(cur); > d3d_format = AV_RL32(cur+76); > w = AV_RL16(cur+80);
Bytestream2 API please. Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
