changeset 14549:acf3241be19b

Initialized BITMAPINFOHEADER to 0 to avoid problems, esp. windows has problems when unused parts have bogus values.
author reimar
date Thu, 20 Jan 2005 22:53:37 +0000
parents ca4949694bfd
children 2d90630fbb13
files libmpcodecs/ve_divx4.c libmpcodecs/ve_libdv.c libmpcodecs/ve_nuv.c libmpcodecs/ve_qtvideo.c libmpcodecs/ve_raw.c libmpcodecs/ve_vfw.c libmpcodecs/ve_xvid.c libmpcodecs/ve_xvid4.c
diffstat 8 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_divx4.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_divx4.c	Thu Jan 20 22:53:37 2005 +0000
@@ -463,7 +463,7 @@
     memset(vf->priv,0,sizeof(struct vf_priv_s));
     vf->priv->mux=(muxer_stream_t*)args;
 
-    mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
+    mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
     mux_v->bih->biWidth=0;
     mux_v->bih->biHeight=0;
--- a/libmpcodecs/ve_libdv.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_libdv.c	Thu Jan 20 22:53:37 2005 +0000
@@ -95,7 +95,7 @@
     vf->priv->enc=dv_encoder_new(0,1,1); // FIXME, parse some options!
     if(!vf->priv->enc) return 0;
     
-    mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
+    mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
     mux_v->bih->biWidth=0;
     mux_v->bih->biHeight=0;
--- a/libmpcodecs/ve_nuv.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_nuv.c	Thu Jan 20 22:53:37 2005 +0000
@@ -200,7 +200,7 @@
   memcpy(vf->priv, &nuv_priv_dflt,sizeof(struct vf_priv_s));
   vf->priv->mux=(muxer_stream_t*)args;
   
-  mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
+  mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER));
   mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
   mux_v->bih->biWidth=0;
   mux_v->bih->biHeight=0;
--- a/libmpcodecs/ve_qtvideo.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_qtvideo.c	Thu Jan 20 22:53:37 2005 +0000
@@ -285,7 +285,7 @@
     memset(vf->priv,0,sizeof(struct vf_priv_s));
     vf->priv->mux=(muxer_stream_t*)args;
 
-    mux_v->bih=malloc(sizeof(BITMAPINFOHEADER)+MAX_IDSIZE);
+    mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER)+MAX_IDSIZE);
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+MAX_IDSIZE;
     mux_v->bih->biWidth=0;
     mux_v->bih->biHeight=0;
--- a/libmpcodecs/ve_raw.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_raw.c	Thu Jan 20 22:53:37 2005 +0000
@@ -133,7 +133,7 @@
     memset(vf->priv, 0, sizeof(struct vf_priv_s));
     vf->priv->mux = (muxer_stream_t*)args;
     
-    mux_v->bih = malloc(sizeof(BITMAPINFOHEADER));
+    mux_v->bih = calloc(1, sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize = sizeof(BITMAPINFOHEADER);
     mux_v->bih->biWidth = 0;
     mux_v->bih->biHeight = 0;
--- a/libmpcodecs/ve_vfw.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_vfw.c	Thu Jan 20 22:53:37 2005 +0000
@@ -258,7 +258,7 @@
     memset(vf->priv,0,sizeof(struct vf_priv_s));
     vf->priv->mux=(muxer_stream_t*)args;
 
-    vfw_bih=malloc(sizeof(BITMAPINFOHEADER));
+    vfw_bih=calloc(1, sizeof(BITMAPINFOHEADER));
     vfw_bih->biSize=sizeof(BITMAPINFOHEADER);
     vfw_bih->biWidth=0; // FIXME ?
     vfw_bih->biHeight=0;
--- a/libmpcodecs/ve_xvid.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_xvid.c	Thu Jan 20 22:53:37 2005 +0000
@@ -547,7 +547,7 @@
     memset(vf->priv, 0, sizeof(struct vf_priv_s));
     vf->priv->mux = (muxer_stream_t*)args;
 
-    vf->priv->mux->bih = malloc(sizeof(BITMAPINFOHEADER));
+    vf->priv->mux->bih = calloc(1, sizeof(BITMAPINFOHEADER));
     vf->priv->mux->bih->biSize = sizeof(BITMAPINFOHEADER);
     vf->priv->mux->bih->biWidth = 0;
     vf->priv->mux->bih->biHeight = 0;
--- a/libmpcodecs/ve_xvid4.c	Thu Jan 20 20:22:58 2005 +0000
+++ b/libmpcodecs/ve_xvid4.c	Thu Jan 20 22:53:37 2005 +0000
@@ -570,7 +570,7 @@
 	mod->mux = (muxer_stream_t*)args;
 
 	/* Initialize muxer BITMAP header */
-	mod->mux->bih = malloc(sizeof(BITMAPINFOHEADER));
+	mod->mux->bih = calloc(1, sizeof(BITMAPINFOHEADER));
 
 	if(mod->mux->bih  == NULL) {
 		mp_msg(MSGT_MENCODER,MSGL_ERR,