aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-12 21:12:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-12 21:13:07 +0200
commit98c7f9741eddeeaf037d820d86ff10787e4d5bba (patch)
tree8cd042b26fcceb28d6919e71c076c6e7dfd0b087
parentf14fc55969d8662a7572ea5a3bc2fb151ea0d2ed (diff)
parent86eee85daddb682fa072c2e2657c90a514b855e3 (diff)
downloadffmpeg-98c7f9741eddeeaf037d820d86ff10787e4d5bba.tar.gz
Merge commit '86eee85daddb682fa072c2e2657c90a514b855e3'
* commit '86eee85daddb682fa072c2e2657c90a514b855e3': bytestream2: set the reader to the end when reading more than available Merged-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/bytestream.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
index c2cb601806..7c05ea6cf5 100644
--- a/libavcodec/bytestream.h
+++ b/libavcodec/bytestream.h
@@ -71,8 +71,10 @@ static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \
} \
static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \
{ \
- if (g->buffer_end - g->buffer < bytes) \
+ if (g->buffer_end - g->buffer < bytes) { \
+ g->buffer = g->buffer_end; \
return 0; \
+ } \
return bytestream2_get_ ## name ## u(g); \
} \
static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \