]> git.sesse.net Git - nageru/blobdiff - futatabi/main.cpp
Fix a leak in test code.
[nageru] / futatabi / main.cpp
index 7343df189a3d86aa41ee357c9841aa60d723dab2..69ef55bedc33b89f2f85ad156e13e3b3708412c7 100644 (file)
@@ -240,7 +240,10 @@ int main(int argc, char **argv)
        {
                QSurface *surface = create_surface();
                QOpenGLContext *context = create_context(surface);
-               make_current(context, surface);
+               if (!make_current(context, surface)) {
+                       printf("oops\n");
+                       exit(1);
+               }
                CHECK(movit::init_movit(MOVIT_SHADER_DIR, movit::MOVIT_DEBUG_OFF));
                delete_context(context);
                // TODO: Delete the surface, too.
@@ -279,7 +282,7 @@ void load_frame_file(const char *filename, const string &basename, unsigned file
        if (!all_frames.empty()) {
                // We already had this cached in the database, so no need to look in the file.
                for (const DB::FrameOnDiskAndStreamIdx &frame : all_frames) {
-                       if (frame.stream_idx >= 0 && frame.stream_idx < MAX_STREAMS) {
+                       if (frame.stream_idx < MAX_STREAMS) {
                                frames[frame.stream_idx].push_back(frame.frame);
                                start_pts = max(start_pts, frame.frame.pts);
                        }