[FFmpeg-devel] some minor cleanup (and one leak fix) for dshow

Michael Niedermayer michaelni at gmx.at
Sun Aug 19 18:39:22 CEST 2012


On Fri, Aug 17, 2012 at 03:08:26PM -0600, Roger Pack wrote:
> $subj

>  dshow.c  |    2 +-
>  vfwcap.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 8ad7074f56b70393409e7ab2bad48d044da15c4f  0001-dshow-avoid-integer-overflow.patch
> From 33e405d46878f0c3f325436770ebd303d53ba145 Mon Sep 17 00:00:00 2001
> From: rogerdpack <rogerpack2005 at gmail.com>
> Date: Wed, 15 Aug 2012 12:50:45 -0600
> Subject: [PATCH 1/3] dshow: avoid integer overflow
> 
> Signed-off-by: rogerdpack <rogerpack2005 at gmail.com>
> ---
>  libavdevice/dshow.c  |    2 +-
>  libavdevice/vfwcap.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index 93bca1d..0bf7a37 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -187,7 +187,7 @@ static int shall_we_drop(AVFormatContext *s)
>      struct dshow_ctx *ctx = s->priv_data;
>      const uint8_t dropscore[] = {62, 75, 87, 100};
>      const int ndropscores = FF_ARRAY_ELEMS(dropscore);
> -    unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
> +    unsigned int buffer_fullness = ((float)ctx->curbufsize*100)/s->max_picture_buffer;

this and the 2nd hunk should use int64_t to avoid rounding issues


[...]

>  dshow.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 44d642659fe2834ed94bddbd047e6d076cdecb5a  0002-dshow-cleanup-reference.patch
> From a3dbbb98091401350474f43b7d37f69408781a84 Mon Sep 17 00:00:00 2001
> From: rogerdpack <rogerpack2005 at gmail.com>
> Date: Thu, 16 Aug 2012 10:42:46 -0600
> Subject: [PATCH 2/3] dshow: cleanup reference

applied

[...]

>  dshow.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 263874815beca22789f32fec86119f183feea1c1  0003-dshow-protect-access-to-curbufsize.patch
> From 58a1e9f19aab19597ce4e995a8ede055ab3e4081 Mon Sep 17 00:00:00 2001
> From: rogerdpack <rogerpack2005 at gmail.com>
> Date: Thu, 16 Aug 2012 10:43:40 -0600
> Subject: [PATCH 3/3] dshow: protect access to curbufsize

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120819/db149d07/attachment.asc>


More information about the ffmpeg-devel mailing list