* @param p probe buffer
* @return 0 when the probe buffer does not contain rl2 data, > 0 otherwise
*/
-static int rl2_probe(AVProbeData *p)
+static int rl2_probe(const AVProbeData *p)
{
if(AV_RB32(&p->buf[0]) != FORM_TAG)
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);