[FFmpeg-devel] [PATCH 15/15] vfwcap: Fix some warnings about incompatible pointer type

Michael Niedermayer michaelni at gmx.at
Fri Jul 27 19:30:12 CEST 2012


On Fri, Jul 27, 2012 at 02:27:05PM -0300, jamal wrote:
> On 27/07/12 2:11 PM, Michael Niedermayer wrote:
> > On Fri, Jul 27, 2012 at 05:23:25AM -0300, jamal wrote:
> >> ---
> >>  libavdevice/vfwcap.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
> >> index d8e32ce..6a4cea0 100644
> >> --- a/libavdevice/vfwcap.c
> >> +++ b/libavdevice/vfwcap.c
> >> @@ -322,7 +322,7 @@ static int vfw_read_header(AVFormatContext *s)
> >>      }
> >>  
> >>      if (ctx->video_size) {
> >> -        ret = av_parse_video_size(&bi->bmiHeader.biWidth, &bi->bmiHeader.biHeight, ctx->video_size);
> >> +        ret = av_parse_video_size((int *)&bi->bmiHeader.biWidth, (int *)&bi->bmiHeader.biHeight, ctx->video_size);
> > 
> > what are the types of biWidth and biHeight ?
> > if they arent int then the cast is likely wrong
> > 
> They are long, but av_parse_video_size() expects them to be int.

i guess adding 2 long variables, using them and copying between them
and the int is the most correct way to solve this.
the cast would require sizeof(int) == sizeof(long) this may be true
for everything supporting vfw, but then it also maybe isnt true for
all, i dont know that ...

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

There will always be a question for which you do not know the correct awnser.
-------------- 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/20120727/7b7dc8d5/attachment.asc>


More information about the ffmpeg-devel mailing list