Browse code

ffplay: avoid SIGFPE exception in SDL_DisplayYUVOverlay

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>

Stefano Sabatini authored on 2011/04/23 00:11:23
Showing 1 changed files
... ...
@@ -752,8 +752,8 @@ static void video_image_display(VideoState *is)
752 752
         }
753 753
         rect.x = is->xleft + x;
754 754
         rect.y = is->ytop  + y;
755
-        rect.w = width;
756
-        rect.h = height;
755
+        rect.w = FFMAX(width,  1);
756
+        rect.h = FFMAX(height, 1);
757 757
         SDL_DisplayYUVOverlay(vp->bmp, &rect);
758 758
     } else {
759 759
 #if 0