[aravis] gv_stream: avoid a crash in case of a data gvsp packet with packet_id = 0.



commit c6dc7b573124d57086b534bb7b78cd9e5ca14e3f
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sat May 14 22:31:31 2011 +0200

    gv_stream: avoid a crash in case of a data gvsp packet with packet_id = 0.

 src/arvgvstream.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/arvgvstream.c b/src/arvgvstream.c
index 8e38898..34a31c4 100644
--- a/src/arvgvstream.c
+++ b/src/arvgvstream.c
@@ -216,7 +216,7 @@ _process_data_block (ArvGvStreamThreadData *thread_data,
 	if (frame->buffer->status != ARV_BUFFER_STATUS_FILLING)
 		return;
 
-	if (packet_id > frame->n_packets - 2) {
+	if (packet_id > frame->n_packets - 2 || packet_id < 1) {
 		arv_gvsp_packet_debug (packet, read_count, ARV_DEBUG_LEVEL_DEBUG);
 		frame->buffer->status = ARV_BUFFER_STATUS_WRONG_PACKET_ID;
 		return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]