summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libvdpau/h264_parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libvdpau/h264_parser.c b/src/libvdpau/h264_parser.c
index fdc48f043..fcec0b92e 100644
--- a/src/libvdpau/h264_parser.c
+++ b/src/libvdpau/h264_parser.c
@@ -1201,6 +1201,13 @@ int parse_frame(struct nal_parser *parser, uint8_t *inbuf, int inbuf_len,
* copy the left data into prebuf
*/
if(parsed_len < inbuf_len) {
+ if (inbuf_len-parsed_len + parser->prebuf_len > MAX_FRAME_SIZE) {
+ printf("buf underrun!!\n");
+ parser->prebuf_len = 0;
+ *ret_len = 0;
+ *ret_buf = NULL;
+ return parsed_len;
+ }
parser->incomplete_nal = 1;
xine_fast_memcpy(parser->prebuf + parser->prebuf_len, inbuf, inbuf_len-parsed_len);
parser->prebuf_len += inbuf_len-parsed_len;