if(signature == RLV3_TAG && back_size > 0)
st->codecpar->extradata_size += back_size;
- if(ff_get_extradata(s, st->codecpar, pb, st->codecpar->extradata_size) < 0)
- return AVERROR(ENOMEM);
+ ret = ff_get_extradata(s, st->codecpar, pb, st->codecpar->extradata_size);
+ if (ret < 0)
+ return ret;
/** setup audio stream if present */
if(sound_rate){
/** read offset and size tables */
for(i=0; i < frame_count;i++) {
- if (avio_feof(pb))
- return AVERROR_INVALIDDATA;
+ if (avio_feof(pb)) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
chunk_size[i] = avio_rl32(pb);
}
for(i=0; i < frame_count;i++) {
- if (avio_feof(pb))
- return AVERROR_INVALIDDATA;
+ if (avio_feof(pb)) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
chunk_offset[i] = avio_rl32(pb);
}
for(i=0; i < frame_count;i++) {
- if (avio_feof(pb))
- return AVERROR_INVALIDDATA;
+ if (avio_feof(pb)) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
audio_size[i] = avio_rl32(pb) & 0xFFFF;
}
++video_frame_counter;
}
-
+end:
av_free(chunk_size);
av_free(audio_size);
av_free(chunk_offset);
/** fill the packet */
ret = av_get_packet(pb, pkt, sample->size);
if(ret != sample->size){
- av_packet_unref(pkt);
return AVERROR(EIO);
}