]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/flic.c
lavf/segment: simplify segment_count update
[ffmpeg] / libavformat / flic.c
index e04e2778c9ca007090cd3e48bc3ec77bfc71b83b..7235f2e18822e40037fca76ca2a515a160ccfbc0 100644 (file)
@@ -125,10 +125,8 @@ static int flic_read_header(AVFormatContext *s)
     }
 
     /* send over the whole 128-byte FLIC header */
-    st->codec->extradata = av_malloc(FLIC_HEADER_SIZE);
-    if (!st->codec->extradata)
+    if (ff_alloc_extradata(st->codec, FLIC_HEADER_SIZE))
         return AVERROR(ENOMEM);
-    st->codec->extradata_size = FLIC_HEADER_SIZE;
     memcpy(st->codec->extradata, header, FLIC_HEADER_SIZE);
 
     /* peek at the preamble to detect TFTD videos - they seem to always start with an audio chunk */
@@ -178,10 +176,8 @@ static int flic_read_header(AVFormatContext *s)
 
         /* send over abbreviated FLIC header chunk */
         av_free(st->codec->extradata);
-        st->codec->extradata = av_malloc(12);
-        if (!st->codec->extradata)
+        if (ff_alloc_extradata(st->codec, 12))
             return AVERROR(ENOMEM);
-        st->codec->extradata_size = 12;
         memcpy(st->codec->extradata, header, 12);
 
     } else if (magic_number == FLIC_FILE_MAGIC_1) {