mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
ffplay: do not allow wider window than 16383
SDL surface pitch is 16bit, to avoid possible overflows, we limit the window width to 16383. Fixes ticket #2428. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
3b6f1526c6
commit
87917a3283
11
ffplay.c
11
ffplay.c
@ -1080,6 +1080,7 @@ static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp
|
|||||||
w = default_width;
|
w = default_width;
|
||||||
h = default_height;
|
h = default_height;
|
||||||
}
|
}
|
||||||
|
w = FFMIN(16383, w);
|
||||||
if (screen && is->width == screen->w && screen->w == w
|
if (screen && is->width == screen->w && screen->w == w
|
||||||
&& is->height== screen->h && screen->h == h && !force_set_video_mode)
|
&& is->height== screen->h && screen->h == h && !force_set_video_mode)
|
||||||
return 0;
|
return 0;
|
||||||
@ -3249,10 +3250,14 @@ static void event_loop(VideoState *cur_stream)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_VIDEORESIZE:
|
case SDL_VIDEORESIZE:
|
||||||
screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
|
screen = SDL_SetVideoMode(FFMIN(16383, event.resize.w), event.resize.h, 0,
|
||||||
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
|
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
|
||||||
screen_width = cur_stream->width = event.resize.w;
|
if (!screen) {
|
||||||
screen_height = cur_stream->height = event.resize.h;
|
fprintf(stderr, "Failed to set video mode\n");
|
||||||
|
do_exit(cur_stream);
|
||||||
|
}
|
||||||
|
screen_width = cur_stream->width = screen->w;
|
||||||
|
screen_height = cur_stream->height = screen->h;
|
||||||
cur_stream->force_refresh = 1;
|
cur_stream->force_refresh = 1;
|
||||||
break;
|
break;
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user