uint32_t vsize;
uint16_t asize;
uint16_t auxsize;
+ int ret;
av_dlog(s, "%s(%d)\n", __FUNCTION__, fill_header);
st[s->streams[1]->id] = s->streams[1];
if (vsize && st[NSV_ST_VIDEO]) {
- int ret;
nst = st[NSV_ST_VIDEO]->priv_data;
pkt = &nsv->ahead[NSV_ST_VIDEO];
if ((ret = av_get_packet(pb, pkt, vsize)) < 0)
bps = avio_r8(pb);
channels = avio_r8(pb);
samplerate = avio_rl16(pb);
+ if (!channels || !samplerate)
+ return AVERROR_INVALIDDATA;
asize-=4;
av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
if (fill_header) {
if (bps != 16) {
av_dlog(s, "NSV AUDIO bit/sample != 16 (%d)!!!\n", bps);
}
- if(channels)
- bps /= channels; // ???
- else
- av_log(s, AV_LOG_WARNING, "Channels is 0\n");
+ bps /= channels; // ???
if (bps == 8)
st[NSV_ST_AUDIO]->codec->codec_id = AV_CODEC_ID_PCM_U8;
samplerate /= 4;/* UGH ??? XXX */
av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
}
}
- av_get_packet(pb, pkt, asize);
+ if ((ret = av_get_packet(pb, pkt, asize)) < 0)
+ return ret;
pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO;
pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) {