;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2020, 2021 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu tests virtualization) #:use-module (gnu tests) #:use-module (gnu image) #:use-module (gnu syste
aboutsummaryrefslogtreecommitdiff
blob: bef3448b819b1fde34f478111fcb8d2bee6947fd (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Patch contents copied from Mozilla esr45 changeset 312077:7ebfe49f001c

  changeset:   312077:7ebfe49f001c
  user:        Randell Jesup <rjesup@jesup.org>
  Date:        Fri Apr 15 23:11:01 2016 -0400
  summary:     Bug 1263384: validate input frames against configured resolution in vp8 r=rillian, a=ritu,lizzard

  MozReview-Commit-ID: BxDCnJe0mzs

--- libvpx-1.5.0/vp8/vp8_cx_iface.c.orig	2015-11-09 17:12:38.000000000 -0500
+++ libvpx-1.5.0/vp8/vp8_cx_iface.c	2016-06-08 08:48:46.037213092 -0400
@@ -860,11 +860,20 @@
     if (img != NULL) {
       res = image2yuvconfig(img, &sd);
 
-      if (vp8_receive_raw_frame(ctx->cpi, ctx->next_frame_flag | lib_flags, &sd,
-                                dst_time_stamp, dst_end_time_stamp)) {
-        VP8_COMP *cpi = (VP8_COMP *)ctx->cpi;
-        res = update_error_state(ctx, &cpi->common.error);
-      }
+            if (sd.y_width != ctx->cfg.g_w || sd.y_height != ctx->cfg.g_h) {
+                /* from vp8_encoder.h for g_w/g_h:
+                   "Note that the frames passed as input to the encoder must have this resolution"
+                */
+                ctx->base.err_detail = "Invalid input frame resolution";
+                res = VPX_CODEC_INVALID_PARAM;
+            } else {
+                if (vp8_receive_raw_frame(ctx->cpi, ctx->next_frame_flag | lib_flags,
+                                          &sd, dst_time_stamp, dst_end_time_stamp))
+                {
+                    VP8_COMP *cpi = (VP8_COMP *)ctx->cpi;
+                    res = update_error_state(ctx, &cpi->common.error);
+                }
+            }
 
       /* reset for next frame */
       ctx->next_frame_flag = 0;
onse-parts 'running) ((pid) (number? pid)))))) marionette)) (test-equal "childhurd SSH server replies" "SSH" ;; Check from within the guest whether its childhurd's SSH ;; server is reachable. Do that from the guest: port forwarding ;; to the host won't work because QEMU listens on 127.0.0.1. (marionette-eval '(begin (use-modules (ice-9 match)) (let loop ((n 60)) (if (zero? n) 'all-attempts-failed (let ((s (socket PF_INET SOCK_STREAM 0)) (a (make-socket-address AF_INET INADDR_LOOPBACK 10022))) (format #t "connecting to childhurd SSH server...~%") (connect s a) (match (get-string-n s 3) ((? eof-object?) (close-port s) (sleep 1) (loop (- n 1))) (str (close-port s) str)))))) marionette)) (test-equal "SSH up and running" "childhurd GNU\n" ;; Connect from the guest to the chidhurd over SSH and run the ;; 'uname' command. (marionette-eval '(begin (use-modules (ice-9 popen)) (get-string-all (open-input-pipe #$run-uname-over-ssh))) marionette)) (test-end)))) (gexp->derivation "childhurd-test" test)) (define %test-childhurd (system-test (name "childhurd") (description "Connect to the GNU/Hurd virtual machine service, aka. a childhurd, making sure that the childhurd boots and runs its SSH server.") (value (run-childhurd-test))))