diff dvdata.h @ 9855:756ac43c7fd9 libavcodec

check if frame size matches old sys and assumes corrupted input, fixes #1192
author bcoudurier
date Sun, 14 Jun 2009 22:34:28 +0000
parents e9d9d946f213
children 9acd9b34b2b9
line wrap: on
line diff
--- a/dvdata.h	Sun Jun 14 09:55:28 2009 +0000
+++ b/dvdata.h	Sun Jun 14 22:34:28 2009 +0000
@@ -698,7 +698,9 @@
  */
 #define DV_MAX_BPM 8
 
-static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
+static inline
+const DVprofile* dv_frame_profile(const DVprofile *sys,
+                                  const uint8_t* frame, unsigned buf_size)
 {
    int i;
 
@@ -715,6 +717,10 @@
        if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
            return &dv_profiles[i];
 
+   /* check if old sys matches and assumes corrupted input */
+   if (sys && buf_size == sys->frame_size)
+       return sys;
+
    return NULL;
 }