pkgsrc/mbone/vic/patches/patch-ap
joerg 050476bae9 Add DragonFly support. Fix compilation with GCC 3.4+:
When method_ is not set, assume it means the default dither algorithm,
set it to NULL in disable(). This can also avoid possible segfaults.
Bump revision.
2006-02-27 15:49:56 +00:00

25 lines
974 B
Text

$NetBSD: patch-ap,v 1.2 2006/02/27 15:49:56 joerg Exp $
--- color-true.cc.orig 1996-03-04 11:32:13.000000000 +0000
+++ color-true.cc
@@ -173,14 +173,17 @@ typedef void (TrueWindowRenderer::*TrueM
class TrueWindowRenderer : public WindowDitherer {
public:
TrueWindowRenderer(VideoWindow* vw, int decimation, TrueColorModel& cm)
- : WindowDitherer(vw, decimation), cm_(cm), method_(0){ }
+ : WindowDitherer(vw, decimation), cm_(cm), method_(NULL){ }
void render(const u_char* frm, int off, int x, int w, int h) {
- (this->*method_)(frm, off, x, w, h);
+ if (this->method_)
+ (this->*method_)(frm, off, x, w, h);
+ else
+ dither_null(frm, off, x, w, h);
}
protected:
TrueColorModel& cm_;
virtual void update();
- virtual void disable() { method_ = TrueMethod(WindowRenderer::dither_null); }
+ virtual void disable() { method_ = NULL; }
TrueMethod method_;
void map_422(const u_char* frm, u_int off, u_int x,
u_int width, u_int height) const;