Fix crash with incomplete yuv2 frames.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30972 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-03-28 00:08:28 +00:00
parent 55089a3986
commit 91ec3ae682
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
#endif
}
frame_size=mpi->stride[0]*mpi->h;
if (format == MKTAG('y', 'u', 'v', '2')) {
if (len >= frame_size && format == MKTAG('y', 'u', 'v', '2')) {
int i;
for (i = 1; i < frame_size; i += 2)
mpi->planes[0][i] ^= 128;