summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_screenshot.c
diff options
context:
space:
mode:
authorzuxy <zuxy@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-20 04:33:00 +0000
committerzuxy <zuxy@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-20 04:33:00 +0000
commit6fe158d7e74d7fc6b23da1605be9aa7bbb187859 (patch)
tree2fe136d3b3a4acb5c74e7a9642f474c3a6931f3d /libmpcodecs/vf_screenshot.c
parent57b5a5cf652922d167958ce35a4a8c8ccb287e1f (diff)
downloadmpv-6fe158d7e74d7fc6b23da1605be9aa7bbb187859.tar.bz2
mpv-6fe158d7e74d7fc6b23da1605be9aa7bbb187859.tar.xz
Replace memalign(x) (x > 8) by av_malloc() to prevent crashes on systems
lacking memalign(), e.g. Win32. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31045 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_screenshot.c')
-rw-r--r--libmpcodecs/vf_screenshot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c
index 5c74d38f86..55ed820b1e 100644
--- a/libmpcodecs/vf_screenshot.c
+++ b/libmpcodecs/vf_screenshot.c
@@ -131,7 +131,7 @@ static void scale_image(struct vf_priv_s* priv, mp_image_t *mpi)
dst_stride[0] = priv->stride;
if (!priv->buffer)
- priv->buffer = memalign(16, dst_stride[0]*priv->dh);
+ priv->buffer = av_malloc(dst_stride[0]*priv->dh);
dst[0] = priv->buffer;
sws_scale(priv->ctx, mpi->planes, mpi->stride, 0, priv->dh, dst, dst_stride);
@@ -144,7 +144,7 @@ static void start_slice(struct vf_instance *vf, mp_image_t *mpi)
if (vf->priv->shot) {
vf->priv->store_slices = 1;
if (!vf->priv->buffer)
- vf->priv->buffer = memalign(16, vf->priv->stride*vf->priv->dh);
+ vf->priv->buffer = av_malloc(vf->priv->stride*vf->priv->dh);
}
}
@@ -277,7 +277,7 @@ static void uninit(vf_instance_t *vf)
avcodec_close(vf->priv->avctx);
av_freep(&vf->priv->avctx);
if(vf->priv->ctx) sws_freeContext(vf->priv->ctx);
- if (vf->priv->buffer) free(vf->priv->buffer);
+ if (vf->priv->buffer) av_free(vf->priv->buffer);
free(vf->priv->outbuffer);
free(vf->priv);
}