diff options
author | Mike Scheutzow <scheutzow@alcatel-lucent.com> | 2010-08-17 11:47:44 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-08-17 11:47:44 +0400 |
commit | cb036f905f6ffa7b0dfdb9c35471a8280e00214e (patch) | |
tree | a479c87a7fd9fdc3ba269d9bb3e1d37d3c888edb /ffplay.c | |
parent | f7b8c814609e33d1c558c279644c237240707dc7 (diff) |
Fix SDL crash on specific hardware.
Patch by Mike Scheutzow, mjs973 optonline net
Originally committed as revision 24801 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1373,6 +1373,14 @@ static void alloc_picture(void *opaque) vp->bmp = SDL_CreateYUVOverlay(vp->width, vp->height, SDL_YV12_OVERLAY, screen); + if (!vp->bmp || vp->bmp->pitches[0] < vp->width) { + /* SDL allocates a buffer smaller than requested if the video + * overlay hardware is unable to support the requested size. */ + fprintf(stderr, "Error: the video system does not support an image\n" + "size of %dx%d pixels. Try using -vf \"scale=w:h\"\n" + "to reduce the image size.\n", vp->width, vp->height ); + do_exit(); + } SDL_LockMutex(is->pictq_mutex); vp->allocated = 1; |