[FFmpeg-trac] #62(undetermined:open): aiff flt regression

FFmpeg trac at avcodec.org
Fri May 6 14:33:21 CEST 2011


#62: aiff flt regression
----------------------+---------------------------
Reporter:  ami_stuff  |       Owner:
    Type:  defect     |      Status:  open
Priority:  important  |   Component:  undetermined
 Version:  git        |  Resolution:
Keywords:             |  Blocked By:
Blocking:             |  Reproduced:  1
Analyzed:  0          |
----------------------+---------------------------

Comment (by ami_stuff):

 {{{
 Author: michael
 Date: Sun Dec 13 21:27:29 2009
 New Revision: 20836

 Log:
 Use AV_METADATA_DONT_STRDUP* / use av_malloced metadata instead of
 strduped
 arrays of fixed length.
 Code from ffmbc with changes to adapt to our metadata API.

 Modified:
    trunk/libavformat/aiffdec.c
    trunk/libavformat/apetag.c
    trunk/libavformat/asfdec.c
    trunk/libavformat/avidec.c
    trunk/libavformat/flvdec.c
    trunk/libavformat/oggparsevorbis.c
    trunk/libavformat/soxdec.c
    trunk/libavformat/vqf.c
    trunk/libavformat/wc3movie.c

 Modified: trunk/libavformat/aiffdec.c
 ==============================================================================
 --- trunk/libavformat/aiffdec.c Sun Dec 13 21:24:19 2009        (r20835)
 +++ trunk/libavformat/aiffdec.c Sun Dec 13 21:27:29 2009        (r20836)
 @@ -66,19 +66,20 @@ static int get_tag(ByteIOContext *pb, ui
  /* Metadata string read */
  static void get_meta(AVFormatContext *s, const char *key, int size)
  {
 -    uint8_t str[1024];
 -    int res = get_buffer(s->pb, str, FFMIN(sizeof(str)-1, size));
 +    uint8_t *str = av_malloc(size+1);
 +    int res;
 +
 +    if (!str) {
 +        url_fskip(s->pb, size);
 +        return;
 +    }
 +
 +    res = get_buffer(s->pb, str, size);
      if (res < 0)
          return;

      str[res] = 0;
 -    if (size & 1)
 -        size++;
 -    size -= res;
 -    if (size)
 -        url_fskip(s->pb, size);
 -
 -    av_metadata_set(&s->metadata, key, str);
 +    av_metadata_set2(&s->metadata, key, str,
 AV_METADATA_DONT_STRDUP_VAL);
  }

  /* Returns the number of sound data frames or negative on error */
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/62#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list