summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ffplay.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index e5b0ccee37..8244dfafa3 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -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;