Commit 52dc3600 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'bcbe4f3c'

* commit 'bcbe4f3c':
  idroqdec: Make sure a video stream has been allocated before returning packets
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b4c88a4c bcbe4f3c
......@@ -145,6 +145,8 @@ static int roq_read_packet(AVFormatContext *s,
break;
case RoQ_QUAD_CODEBOOK:
if (roq->video_stream_index < 0)
return AVERROR_INVALIDDATA;
/* packet needs to contain both this codebook and next VQ chunk */
codebook_offset = avio_tell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
codebook_size = chunk_size;
......@@ -194,6 +196,11 @@ static int roq_read_packet(AVFormatContext *s,
st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
}
case RoQ_QUAD_VQ:
if (chunk_type == RoQ_QUAD_VQ) {
if (roq->video_stream_index < 0)
return AVERROR_INVALIDDATA;
}
/* load up the packet */
if (av_new_packet(pkt, chunk_size + RoQ_CHUNK_PREAMBLE_SIZE))
return AVERROR(EIO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment