[FFmpeg-devel] [PATCH 1/2] ffplay: do not allow wider window than 16383

Marton Balint cus at passwd.hu
Thu May 30 23:13:10 CEST 2013


On Thu, 30 May 2013, Reimar Döffinger wrote:

> On Wed, May 29, 2013 at 11:38:50PM +0200, Marton Balint wrote:
>> 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 at passwd.hu>
>> ---
>>  ffplay.c | 12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/ffplay.c b/ffplay.c
>> index 80c3091..2b85c14 100644
>> --- a/ffplay.c
>> +++ b/ffplay.c
>> @@ -1070,7 +1070,7 @@ static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp
>>      if (screen && is->width == screen->w && screen->w == w
>>         && is->height== screen->h && screen->h == h && !force_set_video_mode)
>>          return 0;
>> -    screen = SDL_SetVideoMode(w, h, 0, flags);
>> +    screen = SDL_SetVideoMode(FFMIN(16383, w), h, 0, flags);
>
> Are you sure we do not need to update something to our hacked width?
> In particular, wouldn't the if right above possibly result in us
> reinitializing SDL over and over in certain cases?

You're right, here is an updated patch.

Regards,
Marton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffplay-do-not-allow-wider-window-than-16383.patch
Type: text/x-patch
Size: 1887 bytes
Desc: 
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130530/79fa3360/attachment.bin>


More information about the ffmpeg-devel mailing list