X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=ivfdec.c;h=6dcd66f734d575ceb48474cf332bc1dde693133c;hb=f441a652b7f646edfd32a3bb327ae6cda3e2f412;hp=c7f4a894717f7b9576826e8819e43e1f37313abd;hpb=c1bce6b0aa288743fbd3d4515a9ec8965dc7fe23;p=libvpx diff --git a/ivfdec.c b/ivfdec.c index c7f4a8947..6dcd66f73 100644 --- a/ivfdec.c +++ b/ivfdec.c @@ -8,10 +8,15 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "./ivfdec.h" - #include #include +#include + +#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 @@ -37,8 +42,7 @@ int file_is_ivf(struct VpxInputContext *input_ctx) { 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) {