]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'd017ed878a45171f2f6c69fb9d76401c3c494110'
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 7 Dec 2015 14:57:02 +0000 (15:57 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 7 Dec 2015 14:57:02 +0000 (15:57 +0100)
* commit 'd017ed878a45171f2f6c69fb9d76401c3c494110':
  avi: Use the correct data type

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavformat/avidec.c

index be54b1494d0d3dfda8caa61c4c81df8a90228404,43c178ff7e2cc68cf885892cee708a88eb942718..dc72c1456300d29f49538acb53f7d1257568d113
@@@ -480,8 -367,8 +480,9 @@@ static int avi_read_header(AVFormatCont
      int avih_width      = 0, avih_height = 0;
      int amv_file_format = 0;
      uint64_t list_end   = 0;
+     int64_t pos;
      int ret;
 +    AVDictionaryEntry *dict_entry;
  
      avi->stream_index = -1;
  
                  }
              }
              break;
 +        case MKTAG('s', 't', 'r', 'd'):
 +            if (stream_index >= (unsigned)s->nb_streams
 +                || s->streams[stream_index]->codec->extradata_size
 +                || s->streams[stream_index]->codec->codec_tag == MKTAG('H','2','6','4')) {
 +                avio_skip(pb, size);
 +            } else {
 +                uint64_t cur_pos = avio_tell(pb);
 +                if (cur_pos < list_end)
 +                    size = FFMIN(size, list_end - cur_pos);
 +                st = s->streams[stream_index];
 +
 +                if (size<(1<<30)) {
 +                    if (ff_get_extradata(st->codec, pb, size) < 0)
 +                        return AVERROR(ENOMEM);
 +                }
 +
 +                if (st->codec->extradata_size & 1) //FIXME check if the encoder really did this correctly
 +                    avio_r8(pb);
 +
 +                ret = avi_extract_stream_metadata(st);
 +                if (ret < 0) {
 +                    av_log(s, AV_LOG_WARNING, "could not decoding EXIF data in stream header.\n");
 +                }
 +            }
 +            break;
          case MKTAG('i', 'n', 'd', 'x'):
-             i = avio_tell(pb);
+             pos = avio_tell(pb);
              if (pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) &&
 +                avi->use_odml &&
                  read_braindead_odml_indx(s, 0) < 0 &&
                  (s->error_recognition & AV_EF_EXPLODE))
                  goto fail;