Index: ffplay.c
===================================================================
--- ffplay.c	(revision 24481)
+++ ffplay.c	(working copy)
@@ -1386,6 +1386,10 @@
     /* if the frame is not skipped, then display it */
     if (vp->bmp) {
         AVPicture pict;
+	/* SDLOverlay buffer vp->bmp might be smaller than requested */
+	int dst_width  = FFMIN(vp->width,  vp->bmp->w);
+	int dst_height = FFMIN(vp->height, vp->bmp->h);
+
 #if CONFIG_AVFILTER
         if(vp->picref)
             avfilter_unref_pic(vp->picref);
@@ -1416,11 +1420,11 @@
 
         //FIXME use direct rendering
         av_picture_copy(&pict, &pict_src,
-                        vp->pix_fmt, vp->width, vp->height);
+                        vp->pix_fmt, dst_width, dst_height);
 #else
         sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
         is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
-            vp->width, vp->height, vp->pix_fmt, vp->width, vp->height,
+            vp->width, vp->height, vp->pix_fmt, dst_width, dst_height,
             dst_pix_fmt, sws_flags, NULL, NULL, NULL);
         if (is->img_convert_ctx == NULL) {
             fprintf(stderr, "Cannot initialize the conversion context\n");
