Signed-off-by: James Almer <jamr...@gmail.com>
---
 libavformat/evcdec.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/evcdec.c b/libavformat/evcdec.c
index 890babd3cb..9c4969e78f 100644
--- a/libavformat/evcdec.c
+++ b/libavformat/evcdec.c
@@ -30,6 +30,7 @@
 
 #include "rawdec.h"
 #include "avformat.h"
+#include "avio_internal.h"
 #include "internal.h"
 
 
@@ -192,8 +193,12 @@ static int evc_read_packet(AVFormatContext *s, AVPacket 
*pkt)
     }
 
     while(!au_end_found) {
-
         uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
+
+        ret = ffio_ensure_seekback(s->pb, EVC_NALU_LENGTH_PREFIX_SIZE);
+        if (ret < 0)
+            return ret;
+
         ret = avio_read(s->pb, (unsigned char *)&buf, 
EVC_NALU_LENGTH_PREFIX_SIZE);
         if (ret < 0) {
             av_packet_unref(pkt);
-- 
2.41.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to