[FFmpeg-devel] [PATCH 1/2] avformat/tee: Fix TeeSlave.bsfs pointer array size

Michael Niedermayer michael at niedermayer.cc
Mon May 2 21:54:52 CEST 2016


On Mon, May 02, 2016 at 01:34:45AM +0300, sebechlebskyjan at gmail.com wrote:
> From: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> 
> TeeSlave.bsfs is array of pointers to AVBitStreamFilterContext,
> so element size should be really size of a pointer, not size
> of TeeSlave structure.
> 
> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> ---
>  libavformat/tee.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/tee.c b/libavformat/tee.c
> index 499ef33..879d5b8 100644
> --- a/libavformat/tee.c
> +++ b/libavformat/tee.c
> @@ -324,7 +324,7 @@ static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
>      }
>      tee_slave->header_written = 1;
>  
> -    tee_slave->bsfs = av_calloc(avf2->nb_streams, sizeof(TeeSlave));
> +    tee_slave->bsfs = av_calloc(avf2->nb_streams, sizeof(AVBitStreamFilterContext*));

a sizeof based on tee_slave->bsfs itself instead of its type would
make this kind of bugs harder to create
so maybe that should be used instead but above is ok too

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160502/f7e155a9/attachment.sig>


More information about the ffmpeg-devel mailing list