[PATCH tvtime 15/17] Do not call videoinput_buffer_invalid with a negative index

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

 



Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 src/tvtime.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/tvtime.c b/src/tvtime.c
index 1905387..d016bac 100644
--- a/src/tvtime.c
+++ b/src/tvtime.c
@@ -2086,17 +2086,20 @@ int tvtime_main( rtctimer_t *rtctimer, int read_stdin, int realtime,
                 } else {
                     /* Make sure our buffers are valid. */
                     if( fieldsavailable == 2 ) {
-                        if( videoinput_buffer_invalid( vidin, lastframeid ) ) {
+                        if( lastframeid == -1 ||
+			        videoinput_buffer_invalid( vidin, lastframeid ) ) {
                             lastframe = curframe;
                             lastframeid = -1;
                         }
                     } else if( fieldsavailable == 4 ) {
-                        if( videoinput_buffer_invalid( vidin,
+                        if( secondlastframeid == -1 ||
+                                videoinput_buffer_invalid( vidin,
                                                        secondlastframeid ) ) {
                             secondlastframe = curframe;
                             secondlastframeid = -1;
                         }
-                        if( videoinput_buffer_invalid( vidin, lastframeid ) ) {
+                        if( lastframeid == -1 ||
+			        videoinput_buffer_invalid( vidin, lastframeid ) ) {
                             lastframe = curframe;
                             lastframeid = -1;
                         }
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux