OSDN Git Service

avformat/idcin: use ff_get_extradata()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Dec 2013 15:37:42 +0000 (16:37 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Dec 2013 16:38:29 +0000 (17:38 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/idcin.c

index f2d5548..cc25fb0 100644 (file)
@@ -205,15 +205,8 @@ static int idcin_read_header(AVFormatContext *s)
     st->codec->height = height;
 
     /* load up the Huffman tables into extradata */
-    if (ff_alloc_extradata(st->codec, HUFFMAN_TABLE_SIZE))
-        return AVERROR(ENOMEM);
-    ret = avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE);
-    if (ret < 0) {
+    if ((ret = ff_get_extradata(st->codec, pb, HUFFMAN_TABLE_SIZE)) < 0)
         return ret;
-    } else if (ret != HUFFMAN_TABLE_SIZE) {
-        av_log(s, AV_LOG_ERROR, "incomplete header\n");
-        return AVERROR(EIO);
-    }
 
     if (idcin->audio_present) {
         idcin->audio_present = 1;