On Wed, Dec 14, 2011 at 05:42:44PM +0530, Shitiz Garg wrote:
> From 8e1b584348522b6959521a0a2ac0756402291545 Mon Sep 17 00:00:00 2001
> From: Shitiz Garg <[email protected]>
> Date: Wed, 14 Dec 2011 17:33:25 +0530
> Subject: [PATCH] 4xm, added check for making sure prestream_size exists
>
> 4xm: prestream_size would sometime attempt to fetch from invalid location,
> added a check to ensure that doesn't cause in segfaults.
> Fixes bugzilla #135
> ---
> libavcodec/4xm.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
> index 21bde52..129b71e 100644
> --- a/libavcodec/4xm.c
> +++ b/libavcodec/4xm.c
> @@ -664,6 +664,11 @@ static int decode_i_frame(FourXContext *f, const uint8_t
> *buf, int length){
> unsigned int prestream_size= 4*AV_RL32(buf + bitstream_size + 4);
> const uint8_t *prestream= buf + bitstream_size + 12;
>
> + if (prestream_size == NULL) {
that is wrong (hint: look at prestream_size type)
> + av_log(f->avctx, AV_LOG_ERROR, "prestream_size points to an invalid
> location\n");
> + return;
> + }
> +
> if(prestream_size + bitstream_size + 12 != length
> || bitstream_size > (1<<26)
> || prestream_size > (1<<26)){
> --
> 1.7.5.4
>
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel