Revision 7080cbe2

View differences:

libavformat/ffmdec.c
320 320
        default:
321 321
            goto fail;
322 322
        }
323

  
323
        if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
324
            codec->extradata_size = get_be32(pb);
325
            codec->extradata = av_malloc(codec->extradata_size);
326
            if (!codec->extradata)
327
                return AVERROR(ENOMEM);
328
            get_buffer(pb, codec->extradata, codec->extradata_size);
329
        }
324 330
    }
325 331

  
326 332
    /* get until end of block reached */
libavformat/ffmenc.c
168 168
        default:
169 169
            return -1;
170 170
        }
171
        if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
172
            put_be32(pb, codec->extradata_size);
173
            put_buffer(pb, codec->extradata, codec->extradata_size);
174
        }
171 175
    }
172 176

  
173 177
    /* flush until end of block reached */

Also available in: Unified diff