Revision 578d6861

View differences:

libavformat/flvdec.c
135 135
    char str_val[256];
136 136
    int64_t *times = NULL;
137 137
    int64_t *filepositions = NULL;
138
    int ret = 0;
138
    int ret = AVERROR(ENOSYS);
139 139
    int64_t initial_pos = avio_tell(ioc);
140 140

  
141 141
    while (avio_tell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
......
173 173
            num_val = av_int2dbl(avio_rb64(ioc));
174 174
            current_array[i] = num_val;
175 175
        }
176
        if (times && filepositions) {
177
            // All done, exiting at a position allowing amf_parse_object
178
            // to finish parsing the object
179
            ret = 0;
180
            break;
181
        }
176 182
    }
177 183

  
178 184
    if (timeslen == fileposlen)
......
184 190
finish:
185 191
    av_freep(&times);
186 192
    av_freep(&filepositions);
187
    avio_seek(ioc, initial_pos, SEEK_SET);
193
    // If we got unexpected data, but successfully reset back to
194
    // the start pos, the caller can continue parsing
195
    if (ret < 0 && avio_seek(ioc, initial_pos, SEEK_SET) > 0)
196
        return 0;
188 197
    return ret;
189 198
}
190 199

  

Also available in: Unified diff