Commit c7b08bc0 authored by Joakim Plate's avatar Joakim Plate Committed by Justin Ruggles

r3d: Check return value of avio_seek and avoid modifying state if it fails

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJustin Ruggles <justin.ruggles@gmail.com>
parent 8dcd00ea
...@@ -366,7 +366,8 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i ...@@ -366,7 +366,8 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i
frame_num, sample_time); frame_num, sample_time);
if (frame_num < r3d->video_offsets_count) { if (frame_num < r3d->video_offsets_count) {
avio_seek(s->pb, r3d->video_offsets_count, SEEK_SET); if (avio_seek(s->pb, r3d->video_offsets_count, SEEK_SET) < 0)
return -1;
} else { } else {
av_log(s, AV_LOG_ERROR, "could not seek to frame %d\n", frame_num); av_log(s, AV_LOG_ERROR, "could not seek to frame %d\n", frame_num);
return -1; return -1;
......
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