mirror of https://github.com/mpv-player/mpv
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:
parent
55089a3986
commit
91ec3ae682
|
@ -124,7 +124,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
frame_size=mpi->stride[0]*mpi->h;
|
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;
|
int i;
|
||||||
for (i = 1; i < frame_size; i += 2)
|
for (i = 1; i < frame_size; i += 2)
|
||||||
mpi->planes[0][i] ^= 128;
|
mpi->planes[0][i] ^= 128;
|
||||||
|
|
Loading…
Reference in New Issue