summaryrefslogtreecommitdiffstats
path: root/libvo/vo_xv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r--libvo/vo_xv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 98b06a9b92..ad035d724f 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -746,6 +746,9 @@ static uint32_t get_image(mp_image_t *mpi){
if(mpi->type==MP_IMGTYPE_IPB && num_buffers<3 && mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // not enough
if(mpi->type==MP_IMGTYPE_IP && num_buffers<2 && mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // not enough
if(mpi->imgfmt!=image_format || mpi->imgfmt==IMGFMT_BGR24) return VO_FALSE; // needs conversion :(
+ if( xvimage[current_buf]->pitches[0]*mpi->height
+ > xvimage[current_buf]->offsets[1] - xvimage[current_buf]->offsets[0]) return VO_FALSE; //buffer to small
+ if( xvimage[current_buf]->pitches[0] < mpi->width /*FIXME non yv12*/) return VO_FALSE; //buffer to small
// if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram
if( (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)) ||
(mpi->width*(mpi->bpp/8)==xvimage[current_buf]->pitches[0]) ){