diff --git a/ffplay.c b/ffplay.c
index 26a813b0714b2a4d6556e7eede983cc87a312a9e..65b7cb0649bb6fb1b9770c895705c5aa332a2980 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1518,7 +1518,7 @@ static void alloc_picture(VideoState *is)
                                    SDL_YV12_OVERLAY,
                                    screen);
     bufferdiff = vp->bmp ? FFMAX(vp->bmp->pixels[0], vp->bmp->pixels[1]) - FFMIN(vp->bmp->pixels[0], vp->bmp->pixels[1]) : 0;
-    if (!vp->bmp || vp->bmp->pitches[0] < vp->width || bufferdiff < vp->height * vp->bmp->pitches[0]) {
+    if (!vp->bmp || vp->bmp->pitches[0] < vp->width || bufferdiff < (int64_t)vp->height * vp->bmp->pitches[0]) {
         /* SDL allocates a buffer smaller than requested if the video
          * overlay hardware is unable to support the requested size. */
         av_log(NULL, AV_LOG_FATAL,