Revision d509c743

View differences:

libavcodec/dv.c
1119 1119
    int buf_size = avpkt->size;
1120 1120
    DVVideoContext *s = avctx->priv_data;
1121 1121

  
1122
    s->sys = dv_frame_profile(buf);
1122
    s->sys = dv_frame_profile(s->sys, buf, buf_size);
1123 1123
    if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys))
1124 1124
        return -1; /* NOTE: we only accept several full frames */
1125 1125

  
libavcodec/dvdata.h
698 698
 */
699 699
#define DV_MAX_BPM 8
700 700

  
701
static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
701
static inline
702
const DVprofile* dv_frame_profile(const DVprofile *sys,
703
                                  const uint8_t* frame, unsigned buf_size)
702 704
{
703 705
   int i;
704 706

  
......
715 717
       if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
716 718
           return &dv_profiles[i];
717 719

  
720
   /* check if old sys matches and assumes corrupted input */
721
   if (sys && buf_size == sys->frame_size)
722
       return sys;
723

  
718 724
   return NULL;
719 725
}
720 726

  
libavformat/dv.c
322 322
    uint8_t *ppcm[4] = {0};
323 323

  
324 324
    if (buf_size < DV_PROFILE_BYTES ||
325
        !(c->sys = dv_frame_profile(buf)) ||
325
        !(c->sys = dv_frame_profile(c->sys, buf, buf_size)) ||
326 326
        buf_size < c->sys->frame_size) {
327 327
          return -1;   /* Broken frame, or not enough data */
328 328
    }
......
421 421
        url_fseek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
422 422
        return AVERROR(EIO);
423 423

  
424
    c->dv_demux->sys = dv_frame_profile(c->buf);
424
    c->dv_demux->sys = dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
425 425
    if (!c->dv_demux->sys) {
426 426
        av_log(s, AV_LOG_ERROR, "Can't determine profile of DV input stream.\n");
427 427
        return -1;

Also available in: Unified diff