vlc | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Fri Jun 1 15:04:47 2018 +0200| [bcc8c2158898f96c5f29f28eb19d9f9b9c03b4b9] | committer: Francois Cartegnie
vout: osd: fix buffer overflow > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bcc8c2158898f96c5f29f28eb19d9f9b9c03b4b9 --- src/video_output/video_widgets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video_output/video_widgets.c b/src/video_output/video_widgets.c index 95a2bc9d8f..ccb695ace6 100644 --- a/src/video_output/video_widgets.c +++ b/src/video_output/video_widgets.c @@ -212,13 +212,16 @@ static subpicture_region_t *OSDIcon(int type, const video_format_t *fmt) const int x = fmt->i_x_offset + fmt->i_visible_width - margin_ratio * size - width; const int y = fmt->i_y_offset + margin_ratio * size; + if( width < 1 || height < 1 ) + return NULL; + subpicture_region_t *r = OSDRegion(__MAX(x, 0), __MIN(y, (int)fmt->i_visible_height - height), width, height); if (!r) return NULL; - DrawRect(r, STYLE_FILLED, COL_TRANSPARENT, 0, 0, width, height); + DrawRect(r, STYLE_FILLED, COL_TRANSPARENT, 0, 0, width - 1, height - 1); if (type == OSD_PAUSE_ICON) { int bar_width = width / 3; _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits