* be found in the AUTHORS file in the root of the source tree.
*/
-#include "./ivfdec.h"
-
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+
+#include "vpx_ports/mem_ops.h"
+
+#include "./ivfdec.h"
+
+static const char *IVF_SIGNATURE = "DKIF";
static void fix_framerate(int *num, int *den) {
// Some versions of vpxenc used 1/(2*fps) for the timebase, so
int is_ivf = 0;
if (fread(raw_hdr, 1, 32, input_ctx->file) == 32) {
- if (raw_hdr[0] == 'D' && raw_hdr[1] == 'K' &&
- raw_hdr[2] == 'I' && raw_hdr[3] == 'F') {
+ if (memcmp(IVF_SIGNATURE, raw_hdr, 4) == 0) {
is_ivf = 1;
if (mem_get_le16(raw_hdr + 4) != 0) {