Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kanji characters breaks bitmap font handling #650

Closed
inactive123 opened this issue Apr 15, 2014 · 2 comments
Closed

Kanji characters breaks bitmap font handling #650

inactive123 opened this issue Apr 15, 2014 · 2 comments

Comments

@inactive123
Copy link
Contributor

Here's a funny bug -

I was trying to run a video file with the ffmpeg core. It happens to have Kanji characters in the title.

I'll post the video here so you can test it for yourself -

https://anonfiles.com/file/50d0eee32dcaec9512de6a67b591b1a0

This causes a segfault here:

Program received signal SIGSEGV, Segmentation fault.
font_renderer_msg (data=0x2f4c0f0, msg=0x93c730 "INFO - Loading Hikki 眼镜秀 poses with glasses.flv ...",
output=0x7fffffffd040) at gfx/fonts/bitmapfont.c:92
92 tmp->output = handle->bitmap_chars[(unsigned) msg[i]];
(gdb) print tmp->output
$1 = (uint8_t *) 0x0
(gdb) q
A debugging session is active.

Now we don't have to start using Unicode or anything obviously, but maybe we could simply try to 'sanitize' these offending characters before attempting to render them?

@Themaister
Copy link
Contributor

Should be fixed now. Bad cast from char (signed) to unsigned which h cause high-ASCII to turn into 4 billion etc.

EDIT: spottet it in 3 seconds due to lots of similar bugs in various emulator cores ;)

@inactive123
Copy link
Contributor Author

Thanks for that. The video starts up now.

It does still segfault after the video has finished playing though and the core invokes the SHUTDOWN environ callback.

Program received signal SIGABRT, Aborted.
0x00007ffff136e389 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff136e389 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff136f788 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff13ac204 in __libc_message () from /usr/lib/libc.so.6
#3 0x00007ffff13b19ae in malloc_printerr () from /usr/lib/libc.so.6
#4 0x00007ffff13b26b6 in _int_free () from /usr/lib/libc.so.6
#5 0x00007ffff200bc9c in av_freep () from /usr/lib/libavutil.so.52
#6 0x00007ffff1fff9be in av_buffer_unref () from /usr/lib/libavutil.so.52
#7 0x00007ffff20062ea in av_frame_unref () from /usr/lib/libavutil.so.52
#8 0x00007ffff2638733 in avcodec_close () from /usr/lib/libavcodec.so.55
#9 0x00007fffe5819059 in retro_unload_game () from /home/squarepusher/libretro-super/dist/unix/ffmpeg_libretro.so
#10 0x00000000004148d9 in rarch_main_deinit () at retroarch.c:3179
#11 0x000000000040cb05 in main_exit (args=0x0) at frontend/frontend.c:272
#12 0x000000000040c28d in main (argc=, argv=) at frontend/frontend.c:356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants