ffplay: avoid SIGFPE exception in SDL_DisplayYUVOverlay
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Fri, 22 Apr 2011 15:11:23 +0000 (17:11 +0200)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 24 Apr 2011 21:10:26 +0000 (23:10 +0200)
In video_image_display(), fix exception occurring when the size of the
rectangle passed to SDL_DisplayYUVOverlay() is 0x0, which happens when
interactively resizing the SDL window.
This is done by forcing the minimum size to 1x1.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
ffplay.c

index 680215a..b342732 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -752,8 +752,8 @@ static void video_image_display(VideoState *is)
         }
         rect.x = is->xleft + x;
         rect.y = is->ytop  + y;
-        rect.w = width;
-        rect.h = height;
+        rect.w = FFMAX(width,  1);
+        rect.h = FFMAX(height, 1);
         SDL_DisplayYUVOverlay(vp->bmp, &rect);
     } else {
 #if 0