Fix bug: random rubbish at the end of letter.

This commit is contained in:
mini73 2014-10-11 16:56:24 +02:00 committed by Johns
parent a3c0052c4b
commit c2556eb90a
2 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,10 @@
User mini73
Date: Sat Oct 11 16:53:18 CEST 2014
Fix bug: random rubbish at the end of letter.
User johns User johns
Date: Date: Tue Sep 23 12:36:39 CEST 2014
Fix audio thread close race condition. Fix audio thread close race condition.
Support ffmpeg new AVFrame API in the audio codec. Support ffmpeg new AVFrame API in the audio codec.

View File

@ -9736,6 +9736,7 @@ static void VideoEvent(void)
const char *keynam; const char *keynam;
char buf[64]; char buf[64];
char letter[64]; char letter[64];
int letter_len;
uint32_t values[1]; uint32_t values[1];
VideoThreadLock(); VideoThreadLock();
@ -9775,8 +9776,14 @@ static void VideoEvent(void)
break; break;
case KeyPress: case KeyPress:
VideoThreadLock(); VideoThreadLock();
XLookupString(&event.xkey, letter, sizeof(letter), &keysym, NULL); letter_len =
XLookupString(&event.xkey, letter, sizeof(letter) - 1, &keysym,
NULL);
VideoThreadUnlock(); VideoThreadUnlock();
if (letter_len < 0) {
letter_len = 0;
}
letter[letter_len] = '\0';
if (keysym == NoSymbol) { if (keysym == NoSymbol) {
Warning(_("video/event: No symbol for %d\n"), Warning(_("video/event: No symbol for %d\n"),
event.xkey.keycode); event.xkey.keycode);