summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-12-03 12:07:34 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-12-04 08:26:30 +0800
commit3c74ffb01ac3aa567d166362237117a6ca7c0775 (patch)
tree1a68b9cb124a48428247a75ae4c2d83fea3bc0b8 /libavformat/aviobuf.c
parentb236ef0a594e20038b4045e2fecd414f1886d212 (diff)
avformat/aviobuf: check if read_packet() exist before read_packet_wrapper()
without it, read_packet_wrapper() will return AVERROR(EINVAL) and avio_read will be failed. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 5da4dea7b6..14688a2262 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -646,7 +646,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
while (size > 0) {
len = FFMIN(s->buf_end - s->buf_ptr, size);
if (len == 0 || s->write_flag) {
- if((s->direct || size > s->buffer_size) && !s->update_checksum) {
+ if((s->direct || size > s->buffer_size) && !s->update_checksum && s->read_packet) {
// bypass the buffer and read data directly into buf
len = read_packet_wrapper(s, buf, size);
if (len == AVERROR_EOF) {