yop: only set extradata size after it has been successfully allocated
Do not leave a non-zero extradata_size set on failure
This commit is contained in:
parent
b513bf6f69
commit
ab3fdaa713
@ -62,13 +62,12 @@ static int yop_read_header(AVFormatContext *s)
|
|||||||
video_stream = avformat_new_stream(s, NULL);
|
video_stream = avformat_new_stream(s, NULL);
|
||||||
|
|
||||||
// Extra data that will be passed to the decoder
|
// Extra data that will be passed to the decoder
|
||||||
video_stream->codec->extradata_size = 8;
|
|
||||||
|
|
||||||
video_stream->codec->extradata = av_mallocz(video_stream->codec->extradata_size +
|
video_stream->codec->extradata = av_mallocz(8 + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
FF_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
|
|
||||||
if (!video_stream->codec->extradata)
|
if (!video_stream->codec->extradata)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
video_stream->codec->extradata_size = 8;
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
audio_dec = audio_stream->codec;
|
audio_dec = audio_stream->codec;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user