[FFmpeg-devel] [PATCH] Fix of invalid read outside input buffer when decoding vorbis

Måns Rullgård mans
Sun Jul 13 23:34:00 CEST 2008


Siarhei Siamashka <siarhei.siamashka at gmail.com> writes:

> Hi,
>
> This problem was reported by valgrind ("Invalid read of size 4").
>
> -- 
> Best regards,
> Siarhei Siamashka
>
> Index: libavformat/oggparsevorbis.c
> ===================================================================
> --- libavformat/oggparsevorbis.c	(revision 14214)
> +++ libavformat/oggparsevorbis.c	(working copy)
> @@ -146,7 +146,7 @@
>          memcpy(&ptr[offset], priv->packet[i], priv->len[i]);
>          offset += priv->len[i];
>      }
> -    *buf = av_realloc(*buf, offset);
> +    *buf = av_realloc(*buf, offset + FF_INPUT_BUFFER_PADDING_SIZE);
>      return offset;
>  }

OK

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list