X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fyop.c;h=f9ead026a25cc1888158e0c1182cb13879b7ea97;hb=9086af2a0a590c7f576b72379d1708392cd96d5c;hp=e6fd896668cf579aafae161be9b90c74ba21fc1c;hpb=1b98bfb932ad36667ea7f18e24c54978623f6654;p=ffmpeg diff --git a/libavformat/yop.c b/libavformat/yop.c index e6fd896668c..f9ead026a25 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -36,7 +36,7 @@ typedef struct yop_dec_context { int palette_size; } YopDecContext; -static int yop_probe(AVProbeData *probe_packet) +static int yop_probe(const AVProbeData *probe_packet) { if (AV_RB16(probe_packet->buf) == AV_RB16("YO") && probe_packet->buf[2]<10 && @@ -68,10 +68,6 @@ static int yop_read_header(AVFormatContext *s) if (!audio_stream || !video_stream) return AVERROR(ENOMEM); - // Extra data that will be passed to the decoder - if (ff_alloc_extradata(video_stream->codecpar, 8)) - return AVERROR(ENOMEM); - // Audio audio_par = audio_stream->codecpar; audio_par->codec_type = AVMEDIA_TYPE_AUDIO; @@ -94,9 +90,9 @@ static int yop_read_header(AVFormatContext *s) video_stream->sample_aspect_ratio = (AVRational){1, 2}; - ret = avio_read(pb, video_par->extradata, 8); - if (ret < 8) - return ret < 0 ? ret : AVERROR_EOF; + ret = ff_get_extradata(s, video_par, pb, 8); + if (ret < 0) + return ret; yop->palette_size = video_par->extradata[0] * 3 + 4; yop->audio_block_length = AV_RL16(video_par->extradata + 6);